Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 873e0df

Browse files
committed
Fix some compilation warnings when using gcc (-Wmaybe-uninitialized).
2 parents ef64847 + f6d1f1f commit 873e0df

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Objects/unicodeobject.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3530,6 +3530,7 @@ PyUnicode_DecodeLocaleAndSize(const char *str, Py_ssize_t len,
35303530
return unicode;
35313531

35323532
decode_error:
3533+
reason = NULL;
35333534
errmsg = strerror(errno);
35343535
assert(errmsg != NULL);
35353536

@@ -3540,10 +3541,9 @@ PyUnicode_DecodeLocaleAndSize(const char *str, Py_ssize_t len,
35403541
if (wstr != NULL) {
35413542
reason = PyUnicode_FromWideChar(wstr, errlen);
35423543
PyMem_RawFree(wstr);
3543-
} else
3544-
errmsg = NULL;
3544+
}
35453545
}
3546-
if (errmsg == NULL)
3546+
if (reason == NULL)
35473547
reason = PyUnicode_FromString(
35483548
"mbstowcs() encountered an invalid multibyte sequence");
35493549
if (reason == NULL)

0 commit comments

Comments
 (0)