]> diplodocus.org Git - nmh/commit
cpstripped(): Replace malloc()s with statics based on MB_LEN_MAX.
authorRalph Corderoy <ralph@inputplus.co.uk>
Sun, 11 Feb 2018 13:02:24 +0000 (13:02 +0000)
committerRalph Corderoy <ralph@inputplus.co.uk>
Sun, 11 Feb 2018 13:06:35 +0000 (13:06 +0000)
commit2212d4f475b675fc337839f03f1751b32f4eed7e
tree7d12a62354ee59560c03b0ab2b858714c63a29fe
parent4af72ec87eefd3d87da44411557c95c88c2bf3a1
cpstripped(): Replace malloc()s with statics based on MB_LEN_MAX.

MB_CUR_MAX from stdlib.h isn't a compile-time constant so can't be used
for the size of a couple of static char arrays so malloc() was used at
run time, with the tiny claims never being freed.  valgrind(1) noticed
and David suggested MB_LEN_MAX from limits.h instead;  that header's
contents are suitable for #if expressions and thus compile-time
constants.
sbr/fmt_scan.c