Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Apply suggested change.
  • Loading branch information
methane committed May 6, 2021
commit a54b54207f1f93d8fc8fd450f41d60851a807267
5 changes: 2 additions & 3 deletions Python/getargs.c
Original file line number Diff line number Diff line change
Expand Up @@ -2532,13 +2532,12 @@ skipitem(const char **p_format, va_list *p_va, int flags)
}
if (*format == '#') {
if (p_va != NULL) {
if (flags & FLAG_SIZE_T)
(void) va_arg(*p_va, Py_ssize_t *);
else {
if (!(flags & FLAG_SIZE_T)) {
PyErr_SetString(PyExc_SystemError,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rewrite this code in the form:

if (!(flags & FLAG_SIZE_T)) {
    ...
}
(void) va_arg(*p_va, Py_ssize_t *);

"PY_SSIZE_T_CLEAN macro must be defined for '#' formats");
return NULL;
}
(void) va_arg(*p_va, Py_ssize_t *);
}
format++;
} else if ((c == 's' || c == 'z' || c == 'y' || c == 'w')
Expand Down