summaryrefslogtreecommitdiff
path: root/src/ls.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1997-01-28 03:40:18 +0000
committerJim Meyering <jim@meyering.net>1997-01-28 03:40:18 +0000
commit771ab6e1bf8da0bade29ec79c06f1ca8b1263ed7 (patch)
treee55480b12b96b3a786a277ce38faa7074f25dfe7 /src/ls.c
parentb103723acca33ed0add1abfa56ee8b9f3f4ad438 (diff)
downloadcoreutils-771ab6e1bf8da0bade29ec79c06f1ca8b1263ed7.tar.xz
(print_long_format): Fix off-by-one problem in size being passed to strftime.
Diffstat (limited to 'src/ls.c')
-rw-r--r--src/ls.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ls.c b/src/ls.c
index 1ad89984e..aae67d557 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -2139,7 +2139,7 @@ print_long_format (const struct fileinfo *f)
/* Use strftime rather than ctime, because the former can produce
locale-dependent names for the weekday (%a) and month (%b). */
- while (! (s = strftime (p, buf + bufsize - p, fmt, localtime (&when))))
+ while (! (s = strftime (p, buf + bufsize - p - 1, fmt, localtime (&when))))
{
char *newbuf = (char *) alloca (bufsize *= 2);
memcpy (newbuf, buf, p - buf);