Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit14720f7

Browse files
committed
Fix unportable uses of <ctype.h> functions. Per Sergey Koposov.
1 parentbc06506 commit14720f7

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
staticint
26582659
GetDecimalFromHex(charhex)
26592660
{
2660-
if (isdigit(hex))
2661+
if (isdigit((unsignedchar)hex))
26612662
returnhex-'0';
26622663
else
2663-
returntolower(hex)-'a'+10;
2664+
returntolower((unsignedchar)hex)-'a'+10;
26642665
}
26652666

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

2805-
if (isxdigit(hexchar))
2806+
if (isxdigit((unsignedchar)hexchar))
28062807
{
28072808
intval=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((unsignedchar)hexchar))
28142815
{
28152816
cur_ptr++;
28162817
val= (val <<4)+GetDecimalFromHex(hexchar);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp