properly terminal buffer after calling strftime.

This commit is contained in:
mrg 1997-04-13 13:44:13 +00:00
parent a9437d1189
commit 8d51c2f90d
2 changed files with 6 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: pr_time.c,v 1.5 1996/11/14 07:34:46 mikel Exp $ */
/* $NetBSD: pr_time.c,v 1.6 1997/04/13 13:44:13 mrg Exp $ */
/*-
* Copyright (c) 1990, 1993, 1994
@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)pr_time.c 8.2 (Berkeley) 4/4/94";
#else
static char rcsid[] = "$NetBSD: pr_time.c,v 1.5 1996/11/14 07:34:46 mikel Exp $";
static char rcsid[] = "$NetBSD: pr_time.c,v 1.6 1997/04/13 13:44:13 mrg Exp $";
#endif
#endif /* not lint */
@ -84,6 +84,7 @@ pr_attime(started, now)
fmt = __CONCAT("%l:%", "M%p");
(void)strftime(buf, sizeof(buf), fmt, tp);
buf[sizeof(buf) - 1] = '\0';
(void)fputs(buf, stdout);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: w.c,v 1.22 1997/03/31 04:13:15 christos Exp $ */
/* $NetBSD: w.c,v 1.23 1997/04/13 13:44:17 mrg Exp $ */
/*-
* Copyright (c) 1980, 1991, 1993, 1994
@ -43,7 +43,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)w.c 8.6 (Berkeley) 6/30/94";
#else
static char rcsid[] = "$NetBSD: w.c,v 1.22 1997/03/31 04:13:15 christos Exp $";
static char rcsid[] = "$NetBSD: w.c,v 1.23 1997/04/13 13:44:17 mrg Exp $";
#endif
#endif /* not lint */
@ -373,6 +373,7 @@ pr_header(nowp, nusers)
*/
(void)strftime(buf, sizeof(buf),
__CONCAT("%l:%","M%p"), localtime(nowp));
buf[sizeof(buf) - 1] = '\0';
(void)printf("%s ", buf);
/*