summaryrefslogtreecommitdiffstatshomepage
path: root/py
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-05-22 02:22:14 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-05-22 02:22:14 +0300
commit9dde6062cc80152c08e16e7bc3536d53e8a2de05 (patch)
tree1829952a0fcd76fbe90b93e957015b8e81731d5e /py
parent6a60fb3cf4e2596e5c4bfe9fefefa80e7ccbb71e (diff)
downloadmicropython-9dde6062cc80152c08e16e7bc3536d53e8a2de05.tar.gz
micropython-9dde6062cc80152c08e16e7bc3536d53e8a2de05.zip
py/objstr: Fix mix-signed comparison in str.center().
Diffstat (limited to 'py')
-rw-r--r--py/objstr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/py/objstr.c b/py/objstr.c
index 69eb2fcefc..e51c371f7b 100644
--- a/py/objstr.c
+++ b/py/objstr.c
@@ -820,7 +820,7 @@ STATIC mp_obj_t str_rstrip(size_t n_args, const mp_obj_t *args) {
#if MICROPY_PY_BUILTINS_STR_CENTER
STATIC mp_obj_t str_center(mp_obj_t str_in, mp_obj_t width_in) {
GET_STR_DATA_LEN(str_in, str, str_len);
- int width = mp_obj_get_int(width_in);
+ mp_uint_t width = mp_obj_get_int(width_in);
if (str_len >= width) {
return str_in;
}