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

Commitd2f6c3e

Browse files
committed
Fix sizeof(EXE) arithmetic, per Andrew Dunstan.
1 parent6105c9a commitd2f6c3e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎src/port/path.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/port/path.c,v 1.42 2004/11/0601:16:22 tgl Exp $
11+
* $PostgreSQL: pgsql/src/port/path.c,v 1.43 2004/11/0604:24:14 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -285,7 +285,7 @@ get_progname(const char *argv0)
285285
#if defined(__CYGWIN__)|| defined(WIN32)
286286
/* strip .exe suffix, regardless of case */
287287
if (strlen(nodir_name)>sizeof(EXE)-1&&
288-
pg_strcasecmp(nodir_name+strlen(nodir_name)-sizeof(EXE)-1,EXE)==0)
288+
pg_strcasecmp(nodir_name+strlen(nodir_name)-(sizeof(EXE)-1),EXE)==0)
289289
{
290290
char*progname;
291291

@@ -295,7 +295,7 @@ get_progname(const char *argv0)
295295
fprintf(stderr,"%s: out of memory\n",nodir_name);
296296
exit(1);/* This could exit the postmaster */
297297
}
298-
progname[strlen(progname)-sizeof(EXE)-1]='\0';
298+
progname[strlen(progname)-(sizeof(EXE)-1)]='\0';
299299
nodir_name=progname;
300300
}
301301
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp