Skip to content

Commit 14720f7

Browse files
committed
Fix unportable uses of <ctype.h> functions. Per Sergey Koposov.
1 parent bc06506 commit 14720f7

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/backend/commands/copy.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@
88
*
99
*
1010
* 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 $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
1515
#include "postgres.h"
1616

17+
#include <ctype.h>
1718
#include <unistd.h>
1819
#include <sys/stat.h>
1920
#include <netinet/in.h>
@@ -2657,10 +2658,10 @@ CopyReadLineCSV(CopyState cstate)
26572658
static int
26582659
GetDecimalFromHex(char hex)
26592660
{
2660-
if (isdigit(hex))
2661+
if (isdigit((unsigned char) hex))
26612662
return hex - '0';
26622663
else
2663-
return tolower(hex) - 'a' + 10;
2664+
return tolower((unsigned char) hex) - 'a' + 10;
26642665
}
26652666

26662667
/*
@@ -2802,15 +2803,15 @@ CopyReadAttributesText(CopyState cstate, int maxfields, char **fieldvals)
28022803
{
28032804
char hexchar = *cur_ptr;
28042805

2805-
if (isxdigit(hexchar))
2806+
if (isxdigit((unsigned char) hexchar))
28062807
{
28072808
int val = GetDecimalFromHex(hexchar);
28082809

28092810
cur_ptr++;
28102811
if (cur_ptr < line_end_ptr)
28112812
{
28122813
hexchar = *cur_ptr;
2813-
if (isxdigit(hexchar))
2814+
if (isxdigit((unsigned char) hexchar))
28142815
{
28152816
cur_ptr++;
28162817
val = (val << 4) + GetDecimalFromHex(hexchar);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy