]> granicus.if.org Git - postgresql/commitdiff
Use sizeof() rather than strlen() in array size.
authorBruce Momjian <bruce@momjian.us>
Fri, 11 Jun 2004 17:09:13 +0000 (17:09 +0000)
committerBruce Momjian <bruce@momjian.us>
Fri, 11 Jun 2004 17:09:13 +0000 (17:09 +0000)
src/port/path.c

index 864cb1e3a6abc1f7e83d90002ed00722e6bb3727..1f2eb0257858dc4f0b2a02136324270791181cac 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/port/path.c,v 1.19 2004/06/10 22:26:24 momjian Exp $
+ *       $PostgreSQL: pgsql/src/port/path.c,v 1.20 2004/06/11 17:09:13 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -252,7 +252,7 @@ set_pglocale_pgservice(const char *argv0, const char *app)
 {
        char path[MAXPGPATH];
        char my_exec_path[MAXPGPATH];
-       char env_path[MAXPGPATH + strlen("PGLOCALEDIR=")]; /* longer than PGSYSCONFDIR */
+       char env_path[MAXPGPATH + sizeof("PGLOCALEDIR=")]; /* longer than PGSYSCONFDIR */
 
        /* don't set LC_ALL in the backend */
        if (strcmp(app, "postgres") != 0)