diff options
author | Jim Meyering <jim@meyering.net> | 2000-12-31 08:55:41 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2000-12-31 08:55:41 +0000 |
commit | 857c948551fe825421340410762ba0e4b5381345 (patch) | |
tree | bc41492323435c1e07afdc0a1d69b14e48987be3 | |
parent | 33cf956fc89795caa120bc262840bdd701fc9850 (diff) | |
download | coreutils-857c948551fe825421340410762ba0e4b5381345.tar.xz |
(print_long_format): Don't dump core if strftime returns the empty string.
-rw-r--r-- | src/ls.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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); |