Skip to content

Commit 9dde606

Browse files
committed
py/objstr: Fix mix-signed comparison in str.center().
1 parent 6a60fb3 commit 9dde606

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

py/objstr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,7 @@ STATIC mp_obj_t str_rstrip(size_t n_args, const mp_obj_t *args) {
820820
#if MICROPY_PY_BUILTINS_STR_CENTER
821821
STATIC mp_obj_t str_center(mp_obj_t str_in, mp_obj_t width_in) {
822822
GET_STR_DATA_LEN(str_in, str, str_len);
823-
int width = mp_obj_get_int(width_in);
823+
mp_uint_t width = mp_obj_get_int(width_in);
824824
if (str_len >= width) {
825825
return str_in;
826826
}

0 commit comments

Comments
 (0)