While we're doing work here, let's finally handle these:
src/growlight.h:457:28: warning: '%02ju' directive output may be truncated writing between 2 and 17 bytes into a region of size between 0 and 8 [-Wformat-truncation=]
snprintf(buf,bsize,"%ju.%02ju%c%c",val / dv,(val % dv) / ((dv + 99) / 100),
^~~~~
src/growlight.h:457:23: note: directive argument in the range [0, 18014398509481982]
snprintf(buf,bsize,"%ju.%02ju%c%c",val / dv,(val % dv) / ((dv + 99) / 100),
^~~~~~~~~~~~~~~
src/growlight.h:457:4: note: 'snprintf' output between 7 and 41 bytes into a destination of size 10
snprintf(buf,bsize,"%ju.%02ju%c%c",val / dv,(val % dv) / ((dv + 99) / 100),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prefixes[consumed - 1],uprefix);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/growlight.h:457:28: warning: '%02ju' directive output may be truncated writing between 2 and 17 bytes into a region of size between 0 and 8 [-Wformat-truncation=]
snprintf(buf,bsize,"%ju.%02ju%c%c",val / dv,(val % dv) / ((dv + 99) / 100),
^~~~~
src/growlight.h:457:23: note: directive argument in the range [0, 18014398509481982]
snprintf(buf,bsize,"%ju.%02ju%c%c",val / dv,(val % dv) / ((dv + 99) / 100),
^~~~~~~~~~~~~~~
src/growlight.h:457:4: note: 'snprintf' output between 7 and 41 bytes into a destination of size 10
snprintf(buf,bsize,"%ju.%02ju%c%c",val / dv,(val % dv) / ((dv + 99) / 100),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prefixes[consumed - 1],uprefix);
I think explicit length controls would suffice, and also help to document the code.
While we're doing work here, let's finally handle these:
I think explicit length controls would suffice, and also help to document the code.