From 56dd20351195efe3b82a16b960c57730fc68183d Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Sat, 6 Jan 2018 01:45:16 +0000 Subject: [PATCH] print_timespec.c: use xsprintf instead of snprintf * print_timespec.c: Include "xstring.h". (sprint_timespec): Replace snprintf with xsprintf. --- print_timespec.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/print_timespec.c b/print_timespec.c index c8ab5b7b..30b6bba3 100644 --- a/print_timespec.c +++ b/print_timespec.c @@ -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)); } -- 2.40.0