diff options
Diffstat (limited to 'contrib/ntp/libntp/uglydate.c')
-rw-r--r-- | contrib/ntp/libntp/uglydate.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/contrib/ntp/libntp/uglydate.c b/contrib/ntp/libntp/uglydate.c index 676a5fd..66b5139 100644 --- a/contrib/ntp/libntp/uglydate.c +++ b/contrib/ntp/libntp/uglydate.c @@ -2,6 +2,7 @@ * uglydate - convert a time stamp to something barely readable * The string returned is 37 characters long. */ +#include <config.h> #include <stdio.h> #include "ntp_fp.h" @@ -41,8 +42,10 @@ uglydate( while (year >= 100) year -= 100; } - (void) sprintf(bp, "%17s %02d:%03d:%02d:%02d:%02d.%03ld", - timep, year, tm->tm_yday, tm->tm_hour, tm->tm_min, - tm->tm_sec, msec); + snprintf(bp, LIB_BUFLENGTH, + "%17s %02d:%03d:%02d:%02d:%02d.%03ld", timep, year, + tm->tm_yday, tm->tm_hour, tm->tm_min, tm->tm_sec, + msec); + return bp; } |