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

Commit69d4299

Browse files
committed
This patch removes the initialization of ri in loop in
quote_postgres(...) in ecpglib.c.The code in CVS reads:quote_postgres(char *arg, int lineno){ char *res = (char *) ecpg_alloc(2 * strlen(arg) + 3, lineno); int i, ri = 0; if (!res) return (res); res[ri++] = '\''; for (i = 0, ri=0; arg[i]; i++, ri++) { switch (arg[i]) { case '\'': res[ri++] = '\''; break; case '\\': res[ri++] = '\\'; break; default: ; }The problem here is that ri is reset to 0, thus overwriting the initialquote.Stephen Birch
1 parent2515882 commit69d4299

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/interfaces/ecpg/lib/ecpglib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ quote_postgres(char *arg, int lineno)
238238
return (res);
239239

240240
res[ri++]='\'';
241-
for (i=0,ri=0;arg[i];i++,ri++)
241+
for (i=0;arg[i];i++,ri++)
242242
{
243243
switch (arg[i])
244244
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp