Commit 873e0df9 authored by Antoine Pitrou's avatar Antoine Pitrou

Fix some compilation warnings when using gcc (-Wmaybe-uninitialized).

parents ef64847f f6d1f1fa
...@@ -3530,6 +3530,7 @@ PyUnicode_DecodeLocaleAndSize(const char *str, Py_ssize_t len, ...@@ -3530,6 +3530,7 @@ PyUnicode_DecodeLocaleAndSize(const char *str, Py_ssize_t len,
return unicode; return unicode;
decode_error: decode_error:
reason = NULL;
errmsg = strerror(errno); errmsg = strerror(errno);
assert(errmsg != NULL); assert(errmsg != NULL);
...@@ -3540,10 +3541,9 @@ decode_error: ...@@ -3540,10 +3541,9 @@ decode_error:
if (wstr != NULL) { if (wstr != NULL) {
reason = PyUnicode_FromWideChar(wstr, errlen); reason = PyUnicode_FromWideChar(wstr, errlen);
PyMem_RawFree(wstr); PyMem_RawFree(wstr);
} else }
errmsg = NULL;
} }
if (errmsg == NULL) if (reason == NULL)
reason = PyUnicode_FromString( reason = PyUnicode_FromString(
"mbstowcs() encountered an invalid multibyte sequence"); "mbstowcs() encountered an invalid multibyte sequence");
if (reason == NULL) if (reason == NULL)
......
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