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

Commitc2e164f

Browse files
Merge pull request#6 from postgrespro/PGPRO-6866
PGPRO-6866: do not use the function pg_atoi if possible
2 parents9a911f7 +ef4120f commitc2e164f

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

‎tsparser.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,10 @@ typedef struct TParser
269269
inttype;
270270
}TParser;
271271

272+
#ifPG_VERSION_NUM<120000
273+
#definepg_strtoint32(value)pg_atoi((value), sizeof(int32), 0)
274+
#endif
275+
272276

273277
/* forward decls here */
274278
staticboolTParserGet(TParser*prs);
@@ -2533,13 +2537,13 @@ tsparser_headline(PG_FUNCTION_ARGS)
25332537
char*val=defGetString(defel);
25342538

25352539
if (pg_strcasecmp(defel->defname,"MaxWords")==0)
2536-
max_words=pg_atoi(val,sizeof(int32),0);
2540+
max_words=pg_strtoint32(val);
25372541
elseif (pg_strcasecmp(defel->defname,"MinWords")==0)
2538-
min_words=pg_atoi(val,sizeof(int32),0);
2542+
min_words=pg_strtoint32(val);
25392543
elseif (pg_strcasecmp(defel->defname,"ShortWord")==0)
2540-
shortword=pg_atoi(val,sizeof(int32),0);
2544+
shortword=pg_strtoint32(val);
25412545
elseif (pg_strcasecmp(defel->defname,"MaxFragments")==0)
2542-
max_fragments=pg_atoi(val,sizeof(int32),0);
2546+
max_fragments=pg_strtoint32(val);
25432547
elseif (pg_strcasecmp(defel->defname,"StartSel")==0)
25442548
prs->startsel=pstrdup(val);
25452549
elseif (pg_strcasecmp(defel->defname,"StopSel")==0)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp