Kaydet (Commit) 78c2a2e0 authored tarafından Martin v. Löwis's avatar Martin v. Löwis

Fail fatally if strdup fails.

üst d903fc05
......@@ -591,6 +591,8 @@ setup_readline(void)
{
#ifdef SAVE_LOCALE
char *saved_locale = strdup(setlocale(LC_CTYPE, NULL));
if (!saved_locale)
Py_FatalError("not enough memory to save locale");
#endif
using_history();
......@@ -655,6 +657,8 @@ call_readline(FILE *sys_stdin, FILE *sys_stdout, char *prompt)
{
#ifdef SAVE_LOCALE
char *saved_locale = strdup(setlocale(LC_CTYPE, NULL));
if (!saved_locale)
Py_FatalError("not enough memory to save locale");
setlocale(LC_CTYPE, "");
#endif
size_t n;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment