Skip to content

Commit 41e364e

Browse files
committed
Fix potential coredump on bad locale value in pg_upgrade.
Thinko in error report (and a typo in the message text, too). We're failing anyway, but it would be good to print something useful first. Noted while reviewing a patch to make pg_upgrade's locale code laxer.
1 parent 760c770 commit 41e364e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

contrib/pg_upgrade/check.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -990,6 +990,7 @@ get_canonical_locale_name(int category, const char *locale)
990990
char *save;
991991
char *res;
992992

993+
/* get the current setting, so we can restore it. */
993994
save = setlocale(category, NULL);
994995
if (!save)
995996
pg_fatal("failed to get the current locale\n");
@@ -1001,7 +1002,7 @@ get_canonical_locale_name(int category, const char *locale)
10011002
res = setlocale(category, locale);
10021003

10031004
if (!res)
1004-
pg_fatal("failed to get system local name for \"%s\"\n", res);
1005+
pg_fatal("failed to get system locale name for \"%s\"\n", locale);
10051006

10061007
res = pg_strdup(res);
10071008

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