diff options
author | Damien George <damien.p.george@gmail.com> | 2017-08-21 20:47:22 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2017-08-21 20:47:22 +1000 |
commit | 4c736ea8fc046dc564f9167967a5dd92f07ed002 (patch) | |
tree | 179001d76c6574f64b04722522ea7808a0d3e176 /unix | |
parent | b16a755a0b6f471fff8dc1d29794b9c4105fc093 (diff) | |
download | micropython-4c736ea8fc046dc564f9167967a5dd92f07ed002.tar.gz micropython-4c736ea8fc046dc564f9167967a5dd92f07ed002.zip |
extmod,unix: For uos.stat interpret st_size member as an unsigned int.
This prevents large files (eg larger than 2gb on a 32-bit arch) from
showing up as having a negative size. Fixes issue #3227.
Diffstat (limited to 'unix')
-rw-r--r-- | unix/modos.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/unix/modos.c b/unix/modos.c index 8b5d5790f3..5030fbb65b 100644 --- a/unix/modos.c +++ b/unix/modos.c @@ -58,7 +58,7 @@ STATIC mp_obj_t mod_os_stat(mp_obj_t path_in) { t->items[3] = MP_OBJ_NEW_SMALL_INT(sb.st_nlink); t->items[4] = MP_OBJ_NEW_SMALL_INT(sb.st_uid); t->items[5] = MP_OBJ_NEW_SMALL_INT(sb.st_gid); - t->items[6] = MP_OBJ_NEW_SMALL_INT(sb.st_size); + t->items[6] = mp_obj_new_int_from_uint(sb.st_size); t->items[7] = MP_OBJ_NEW_SMALL_INT(sb.st_atime); t->items[8] = MP_OBJ_NEW_SMALL_INT(sb.st_mtime); t->items[9] = MP_OBJ_NEW_SMALL_INT(sb.st_ctime); |