|
8 | 8 | * |
9 | 9 | * |
10 | 10 | * IDENTIFICATION |
11 | | - * $PostgreSQL: pgsql/src/backend/commands/copy.c,v 1.248 2005/08/06 20:41:58 tgl Exp $ |
| 11 | + * $PostgreSQL: pgsql/src/backend/commands/copy.c,v 1.249 2005/09/01 15:34:31 tgl Exp $ |
12 | 12 | * |
13 | 13 | *------------------------------------------------------------------------- |
14 | 14 | */ |
15 | 15 | #include"postgres.h" |
16 | 16 |
|
| 17 | +#include<ctype.h> |
17 | 18 | #include<unistd.h> |
18 | 19 | #include<sys/stat.h> |
19 | 20 | #include<netinet/in.h> |
@@ -2657,10 +2658,10 @@ CopyReadLineCSV(CopyState cstate) |
2657 | 2658 | staticint |
2658 | 2659 | GetDecimalFromHex(charhex) |
2659 | 2660 | { |
2660 | | -if (isdigit(hex)) |
| 2661 | +if (isdigit((unsignedchar)hex)) |
2661 | 2662 | returnhex-'0'; |
2662 | 2663 | else |
2663 | | -returntolower(hex)-'a'+10; |
| 2664 | +returntolower((unsignedchar)hex)-'a'+10; |
2664 | 2665 | } |
2665 | 2666 |
|
2666 | 2667 | /* |
@@ -2802,15 +2803,15 @@ CopyReadAttributesText(CopyState cstate, int maxfields, char **fieldvals) |
2802 | 2803 | { |
2803 | 2804 | charhexchar=*cur_ptr; |
2804 | 2805 |
|
2805 | | -if (isxdigit(hexchar)) |
| 2806 | +if (isxdigit((unsignedchar)hexchar)) |
2806 | 2807 | { |
2807 | 2808 | intval=GetDecimalFromHex(hexchar); |
2808 | 2809 |
|
2809 | 2810 | cur_ptr++; |
2810 | 2811 | if (cur_ptr<line_end_ptr) |
2811 | 2812 | { |
2812 | 2813 | hexchar=*cur_ptr; |
2813 | | -if (isxdigit(hexchar)) |
| 2814 | +if (isxdigit((unsignedchar)hexchar)) |
2814 | 2815 | { |
2815 | 2816 | cur_ptr++; |
2816 | 2817 | val= (val <<4)+GetDecimalFromHex(hexchar); |
|