From: Jim Meyering Date: Sun, 31 Dec 2000 08:55:41 +0000 (+0000) Subject: (print_long_format): Don't dump core if strftime returns the empty string. X-Git-Tag: FILEUTILS-4_0_36~137 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=857c948551fe825421340410762ba0e4b5381345;p=thirdparty%2Fcoreutils.git (print_long_format): Don't dump core if strftime returns the empty string. --- diff --git a/src/ls.c b/src/ls.c index ed1783da7e..ac9a37ab1f 100644 --- a/src/ls.c +++ b/src/ls.c @@ -2453,7 +2453,10 @@ print_long_format (const struct fileinfo *f) if ((when_local = localtime (&when))) { - while (! (s = strftime (p, buf + bufsize - p - 1, fmt, when_local))) + *p = '\1'; + + while (! (s = strftime (p, buf + bufsize - p - 1, fmt, when_local)) + && *p) { char *newbuf = (char *) alloca (bufsize *= 2); memcpy (newbuf, buf, p - buf);