gregjesl/simpleson

Number conversion buffer size

gregjesl opened this issue · 1 comments

The string buffer currently used to convert numbers to strings is fixed:

char cstr[NUMBER_TO_STRING_BUFFER_LENGTH];

Instead, the function should use the known maximum sizes of each type

snprintf can be used to see if the buffer was too small: https://www.cplusplus.com/reference/cstdio/snprintf/