Skip to content

Commit 625ad47

Browse files
lysnikolaouvstinner
andcommitted
Only return NULL when chars < 0 in C test functions
Co-authored-by: Victor Stinner <[email protected]>
1 parent 769d84a commit 625ad47

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Modules/_testcapi/unicode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ unicode_case_operation(PyObject *str, int (*function)(Py_UCS4, Py_UCS4 *, int))
237237

238238
Py_UCS4 buf[3];
239239
int chars = function(c, buf, Py_ARRAY_LENGTH(buf));
240-
if (chars <= 0) {
240+
if (chars < 0) {
241241
return NULL;
242242
}
243243

0 commit comments

Comments
 (0)