diff options
author | Brett Cannon <bcannon@gmail.com> | 2011-02-22 20:15:44 (GMT) |
---|---|---|
committer | Brett Cannon <bcannon@gmail.com> | 2011-02-22 20:15:44 (GMT) |
commit | b94767ff44edf5d461d7cb1c8eb5160f83886358 (patch) | |
tree | b43b482e765b0383b3326779f6815e72b2bacccb /Python/getargs.c | |
parent | 79da6b7075a3d51ae042e77a2afca827e7bce435 (diff) | |
download | cpython-b94767ff44edf5d461d7cb1c8eb5160f83886358.zip cpython-b94767ff44edf5d461d7cb1c8eb5160f83886358.tar.gz cpython-b94767ff44edf5d461d7cb1c8eb5160f83886358.tar.bz2 |
Issue #8914: fix various warnings from the Clang static analyzer v254.
Diffstat (limited to 'Python/getargs.c')
-rw-r--r-- | Python/getargs.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Python/getargs.c b/Python/getargs.c index 600941d..17d5993 100644 --- a/Python/getargs.c +++ b/Python/getargs.c @@ -966,9 +966,10 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags, case 'u': /* raw unicode buffer (Py_UNICODE *) */ case 'Z': /* raw unicode buffer or None */ { + Py_UNICODE **p = va_arg(*p_va, Py_UNICODE **); + if (*format == '#') { /* any buffer-like object */ /* "s#" or "Z#" */ - Py_UNICODE **p = va_arg(*p_va, Py_UNICODE **); FETCH_SIZE; if (c == 'Z' && arg == Py_None) { @@ -984,8 +985,6 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags, format++; } else { /* "s" or "Z" */ - Py_UNICODE **p = va_arg(*p_va, Py_UNICODE **); - if (c == 'Z' && arg == Py_None) *p = NULL; else if (PyUnicode_Check(arg)) { |