From 771ab6e1bf8da0bade29ec79c06f1ca8b1263ed7 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 28 Jan 1997 03:40:18 +0000 Subject: (print_long_format): Fix off-by-one problem in size being passed to strftime. --- src/ls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ls.c') 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); -- cgit v1.2.3-54-g00ecf