summaryrefslogtreecommitdiffstats
path: root/Objects/unicodeobject.c
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2015-05-19 19:06:04 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2015-05-19 19:06:04 (GMT)
commit873e0df946e53af525b515df7773ff72884a8c3b (patch)
tree69fbae98cb10b21688102484f2a3a313b6f91ca3 /Objects/unicodeobject.c
parentef64847f7172d74f793cff179c50435e846690a6 (diff)
parentf6d1f1fa8a503f218a2103ba1e6768c6cfdb7c50 (diff)
downloadcpython-873e0df946e53af525b515df7773ff72884a8c3b.zip
cpython-873e0df946e53af525b515df7773ff72884a8c3b.tar.gz
cpython-873e0df946e53af525b515df7773ff72884a8c3b.tar.bz2
Fix some compilation warnings when using gcc (-Wmaybe-uninitialized).
Diffstat (limited to 'Objects/unicodeobject.c')
-rw-r--r--Objects/unicodeobject.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 548cfff..84e67e6 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -3530,6 +3530,7 @@ PyUnicode_DecodeLocaleAndSize(const char *str, Py_ssize_t len,
return unicode;
decode_error:
+ reason = NULL;
errmsg = strerror(errno);
assert(errmsg != NULL);
@@ -3540,10 +3541,9 @@ decode_error:
if (wstr != NULL) {
reason = PyUnicode_FromWideChar(wstr, errlen);
PyMem_RawFree(wstr);
- } else
- errmsg = NULL;
+ }
}
- if (errmsg == NULL)
+ if (reason == NULL)
reason = PyUnicode_FromString(
"mbstowcs() encountered an invalid multibyte sequence");
if (reason == NULL)