mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-03-01 19:45:33 +08:00
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.
This commit is contained in:
parent
760c770ff6
commit
41e364ec67
@ -990,6 +990,7 @@ get_canonical_locale_name(int category, const char *locale)
|
||||
char *save;
|
||||
char *res;
|
||||
|
||||
/* get the current setting, so we can restore it. */
|
||||
save = setlocale(category, NULL);
|
||||
if (!save)
|
||||
pg_fatal("failed to get the current locale\n");
|
||||
@ -1001,7 +1002,7 @@ get_canonical_locale_name(int category, const char *locale)
|
||||
res = setlocale(category, locale);
|
||||
|
||||
if (!res)
|
||||
pg_fatal("failed to get system local name for \"%s\"\n", res);
|
||||
pg_fatal("failed to get system locale name for \"%s\"\n", locale);
|
||||
|
||||
res = pg_strdup(res);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user