Handle the case where nl_msec2str is passed 0 msecs

This commit is contained in:
Joe Damato 2013-07-18 22:35:45 -07:00
parent 81d2b1d509
commit b3fb89f445

View file

@ -559,6 +559,11 @@ char * nl_msec2str(uint64_t msec, char *buf, size_t len)
#undef _SPLIT
split[4] = msec;
if (msec == 0) {
snprintf(buf, len, "0msec");
return buf_orig;
}
for (i = 0; i < ARRAY_SIZE(split) && len; i++) {
int l;
if (split[i] == 0)