aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-09-01 15:34:31 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-09-01 15:34:31 +0000
commit14720f7c5709f10dbac56e0ff26d9d373904735d (patch)
tree1e0e9ee3f9da79f88489d0be47831be481e065db /src
parentbc0650660a4f71b53c076622467e6894e1f2cf68 (diff)
downloadpostgresql-14720f7c5709f10dbac56e0ff26d9d373904735d.tar.gz
postgresql-14720f7c5709f10dbac56e0ff26d9d373904735d.zip
Fix unportable uses of <ctype.h> functions. Per Sergey Koposov.
Diffstat (limited to 'src')
-rw-r--r--src/backend/commands/copy.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c
index 008413cc97f..7f6fe90c24e 100644
--- a/src/backend/commands/copy.c
+++ b/src/backend/commands/copy.c
@@ -8,12 +8,13 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/copy.c,v 1.248 2005/08/06 20:41:58 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/copy.c,v 1.249 2005/09/01 15:34:31 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
+#include <ctype.h>
#include <unistd.h>
#include <sys/stat.h>
#include <netinet/in.h>
@@ -2657,10 +2658,10 @@ CopyReadLineCSV(CopyState cstate)
static int
GetDecimalFromHex(char hex)
{
- if (isdigit(hex))
+ if (isdigit((unsigned char) hex))
return hex - '0';
else
- return tolower(hex) - 'a' + 10;
+ return tolower((unsigned char) hex) - 'a' + 10;
}
/*
@@ -2802,7 +2803,7 @@ CopyReadAttributesText(CopyState cstate, int maxfields, char **fieldvals)
{
char hexchar = *cur_ptr;
- if (isxdigit(hexchar))
+ if (isxdigit((unsigned char) hexchar))
{
int val = GetDecimalFromHex(hexchar);
@@ -2810,7 +2811,7 @@ CopyReadAttributesText(CopyState cstate, int maxfields, char **fieldvals)
if (cur_ptr < line_end_ptr)
{
hexchar = *cur_ptr;
- if (isxdigit(hexchar))
+ if (isxdigit((unsigned char) hexchar))
{
cur_ptr++;
val = (val << 4) + GetDecimalFromHex(hexchar);