2 ms·
Yeah, you can assume everybody will pass a buffer of length at least ten (2^31 has 10 digits). Oops, make that eleven, for the zero terminator. Oops, make tha
by Someone 12y ago
Yeah, you can assume everybody will pass a buffer of length at least ten (2^31 has 10 digits).
Oops, make that eleven, for the zero terminator.
Oops, make that twelve, for the sign.
Oops, int can be 64 bits, better make that twenty-one.
Oops, sprintf honors locale. There may be thousands separators in there. Make it twenty-seven (or twenty-eight? I lost count. Also, looking at lconv, decimal points and thousands separators need not be at every third digit and may be more than one character long)
Yeah, I am sure that length parameter is superfluous.