Skip to content

Commit 4932008

Browse files
committed
fix size bug
1 parent f9e350a commit 4932008

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Objects/exceptions.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2751,7 +2751,7 @@ PyUnicodeEncodeError_GetStart(PyObject *exc, Py_ssize_t *start)
27512751
if (*start<0)
27522752
*start = 0; /*XXX check for values <0*/
27532753
if (*start>=size)
2754-
*start = size-1;
2754+
*start = size ? size-1 : 0;
27552755
Py_DECREF(obj);
27562756
return 0;
27572757
}

0 commit comments

Comments
 (0)