[Nut-upsdev] common/common.c snprintf warning

Greg Troxel gdt at lexort.com
Mon Mar 31 15:13:05 BST 2025


Jim Klimov <jimklimov+nut at gmail.com> writes:

> It seems bumping all those buffers to [NUT_PATH_MAX+1]` (for the NUL ending
> char) helps, and seems a reasonable thing to do safely.

Sure, if that helps that really seems sensible.

> the char subscripts only with CLANG (13), on my dormant NetBSD 9.2 VM.

NetBSD is louder about it, but ctype(3) is really hard to use correctly
and risks undefined behavior.



More information about the Nut-upsdev mailing list