X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=src%2Fmisc.c;h=f81111f197d53c53c4321668f13e58ca2b9c4324;hb=46b07a52f9dcd3f0a298dfaf85fc0cf502d019dc;hp=cdb2608aa45511cee77721445d4bca2a6e4fa880;hpb=a06b3a29fbd5db12b8cc5ee90b67a061cad41e5d;p=chaz%2Ftar diff --git a/src/misc.c b/src/misc.c index cdb2608..f81111f 100644 --- a/src/misc.c +++ b/src/misc.c @@ -298,6 +298,10 @@ code_timespec (struct timespec t, char sbuf[TIMESPEC_STRSIZE_BOUND]) char *np; bool negative = s < 0; + /* ignore invalid values of ns */ + if (BILLION <= ns || ns < 0) + ns = 0; + if (negative && ns != 0) { s++;