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

Commit89ee5b8

Browse files
committed
Fix some more compatibility issues (ctype.h macros must never be passed
signed chars...)
1 parenteeaef25 commit89ee5b8

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

‎contrib/tsearch2/dict_syn.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ findwrd(char *in, char **end)
3737
char*start;
3838

3939
*end=NULL;
40-
while (*in&&isspace(*in))
40+
while (*in&&isspace((unsignedchar)*in))
4141
in++;
4242

4343
if (!in)
4444
returnNULL;
4545
start=in;
4646

47-
while (*in&& !isspace(*in))
47+
while (*in&& !isspace((unsignedchar)*in))
4848
in++;
4949

5050
*end=in;

‎contrib/tsearch2/prs_dcfg.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ parse_cfgdict(text *in, Map ** m)
6666
{
6767
if (state==CS_WAITKEY)
6868
{
69-
if (isalpha(*ptr))
69+
if (isalpha((unsignedchar)*ptr))
7070
{
7171
begin=ptr;
7272
state=CS_INKEY;
7373
}
74-
elseif (!isspace(*ptr))
74+
elseif (!isspace((unsignedchar)*ptr))
7575
ereport(ERROR,
7676
(errcode(ERRCODE_SYNTAX_ERROR),
7777
errmsg("syntax error"),
@@ -80,7 +80,7 @@ parse_cfgdict(text *in, Map ** m)
8080
}
8181
elseif (state==CS_INKEY)
8282
{
83-
if (isspace(*ptr))
83+
if (isspace((unsignedchar)*ptr))
8484
{
8585
mptr->key=nstrdup(begin,ptr-begin);
8686
state=CS_WAITEQ;
@@ -90,7 +90,7 @@ parse_cfgdict(text *in, Map ** m)
9090
mptr->key=nstrdup(begin,ptr-begin);
9191
state=CS_WAITVALUE;
9292
}
93-
elseif (!isalpha(*ptr))
93+
elseif (!isalpha((unsignedchar)*ptr))
9494
ereport(ERROR,
9595
(errcode(ERRCODE_SYNTAX_ERROR),
9696
errmsg("syntax error"),
@@ -101,7 +101,7 @@ parse_cfgdict(text *in, Map ** m)
101101
{
102102
if (*ptr=='=')
103103
state=CS_WAITVALUE;
104-
elseif (!isspace(*ptr))
104+
elseif (!isspace((unsignedchar)*ptr))
105105
ereport(ERROR,
106106
(errcode(ERRCODE_SYNTAX_ERROR),
107107
errmsg("syntax error"),
@@ -115,7 +115,7 @@ parse_cfgdict(text *in, Map ** m)
115115
begin=ptr+1;
116116
state=CS_INVALUE;
117117
}
118-
elseif (!isspace(*ptr))
118+
elseif (!isspace((unsignedchar)*ptr))
119119
{
120120
begin=ptr;
121121
state=CS_IN2VALUE;
@@ -134,7 +134,7 @@ parse_cfgdict(text *in, Map ** m)
134134
}
135135
elseif (state==CS_IN2VALUE)
136136
{
137-
if (isspace(*ptr)||*ptr==',')
137+
if (isspace((unsignedchar)*ptr)||*ptr==',')
138138
{
139139
mptr->value=nstrdup(begin,ptr-begin);
140140
mptr++;
@@ -147,7 +147,7 @@ parse_cfgdict(text *in, Map ** m)
147147
{
148148
if (*ptr==',')
149149
state=CS_WAITKEY;
150-
elseif (!isspace(*ptr))
150+
elseif (!isspace((unsignedchar)*ptr))
151151
ereport(ERROR,
152152
(errcode(ERRCODE_SYNTAX_ERROR),
153153
errmsg("syntax error"),

‎contrib/tsearch2/tsvector.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ gettoken_tsvector(TI_IN_STATE * state)
310310
}
311311
elseif (state->state==INPOSINFO)
312312
{
313-
if (isdigit(*(state->prsbuf)))
313+
if (isdigit((unsignedchar)*(state->prsbuf)))
314314
{
315315
if (state->alen==0)
316316
{
@@ -373,9 +373,10 @@ gettoken_tsvector(TI_IN_STATE * state)
373373
errmsg("syntax error")));
374374
state->pos[*(uint16*) (state->pos)].weight=0;
375375
}
376-
elseif (isspace(*(state->prsbuf))||*(state->prsbuf)=='\0')
376+
elseif (isspace((unsignedchar)*(state->prsbuf))||
377+
*(state->prsbuf)=='\0')
377378
return1;
378-
elseif (!isdigit(*(state->prsbuf)))
379+
elseif (!isdigit((unsignedchar)*(state->prsbuf)))
379380
ereport(ERROR,
380381
(errcode(ERRCODE_SYNTAX_ERROR),
381382
errmsg("syntax error")));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp