Skip to content

Commit d2f6c3e

Browse files
committed
Fix sizeof(EXE) arithmetic, per Andrew Dunstan.
1 parent 6105c9a commit d2f6c3e

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/06 01:16:22 tgl Exp $
11+
* $PostgreSQL: pgsql/src/port/path.c,v 1.43 2004/11/06 04: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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy