]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(print_long_format): Fix off-by-one problem in size being passed to strftime.
authorJim Meyering <jim@meyering.net>
Tue, 28 Jan 1997 03:40:18 +0000 (03:40 +0000)
committerJim Meyering <jim@meyering.net>
Tue, 28 Jan 1997 03:40:18 +0000 (03:40 +0000)
src/ls.c

index 1ad89984e0568c11488c616cea53c2960430b877..aae67d557b1b028919511b86cbc2f8d5cd5f833f 100644 (file)
--- 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);