RTEMS | cpukit/libmisc/shell:fix command df overflow (!210)
Christian Mauderer (@c-mauderer)
gitlab at rtems.org
Fri Sep 13 08:20:55 UTC 2024
Christian Mauderer started a new discussion on cpukit/libmisc/shell/main_df.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/210#note_112042
>
> struct statvfs svfs;
> int code;
> - char f_buf[16], u_buf[16], a_buf[16];
> + char f_buf[20], u_buf[20], a_buf[20];
Why is it necessary to increase the buffer size? If you use the biggest number (2^64 = 18446744073709551616) The `rtems_shell_df_humanize_size` should make a `16777216T` out of that if I calculated that correctly. So it shouldn't be necessary to increase the size. Or did I miss something?
By the way: Would it be a good idea to add a 'P' and maybe a 'E' to the `suffixes`? With that, the number would get better readable for huge sizes in the peta or exabyte range.
--
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/210#note_112042
You're receiving this email because of your account on gitlab.rtems.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20240913/4d0e5739/attachment.htm>
More information about the bugs
mailing list