1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-04-12 15:06:44 +02:00

(print_long_format): Fix off-by-one problem in size being passed to strftime.

This commit is contained in:
Jim Meyering
1997-01-28 03:40:18 +00:00
parent b103723acc
commit 771ab6e1bf

View File

@@ -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);