print_timespec.c: use xsprintf instead of snprintf

* print_timespec.c: Include "xstring.h".
(sprint_timespec): Replace snprintf with xsprintf.
This commit is contained in:
Дмитрий Левин 2018-01-06 01:45:16 +00:00
parent 4ba39820f1
commit 56dd203511

View File

@ -34,6 +34,8 @@ typedef struct timespec timespec_t;
#include MPERS_DEFS
#include "xstring.h"
#ifndef UTIME_NOW
# define UTIME_NOW ((1l << 30) - 1l)
#endif
@ -125,9 +127,9 @@ MPERS_PRINTER_DECL(const char *, sprint_timespec,
strcpy(buf, "NULL");
} else if (!verbose(tcp) || (exiting(tcp) && syserror(tcp)) ||
umove(tcp, addr, &t)) {
snprintf(buf, sizeof(buf), "%#" PRI_klx, addr);
xsprintf(buf, "%#" PRI_klx, addr);
} else {
snprintf(buf, sizeof(buf), timespec_fmt,
xsprintf(buf, timespec_fmt,
(long long) t.tv_sec,
zero_extend_signed_to_ull(t.tv_nsec));
}