-/* $OpenBSD: pr_time.c,v 1.7 1996/07/13 17:24:50 deraadt Exp $ */
+/* $OpenBSD: pr_time.c,v 1.8 1997/03/25 21:25:59 deraadt Exp $ */
/*-
* Copyright (c) 1990, 1993, 1994
(void)strcpy(fmt, __CONCAT("%l:%", "M%p"));
}
- (void)strftime(buf, sizeof(buf), fmt, tp);
+ (void)strftime(buf, sizeof(buf) -1, fmt, tp);
+ buf[sizeof buf - 1] = '\0';
(void)printf("%s", buf);
}
-/* $OpenBSD: w.c,v 1.13 1997/02/19 11:16:04 angelos Exp $ */
+/* $OpenBSD: w.c,v 1.14 1997/03/25 21:24:12 deraadt Exp $ */
/*-
* Copyright (c) 1980, 1991, 1993, 1994
* SCCS forces the string manipulation below, as it replaces
* %, M, and % in a character string with the file name.
*/
- (void)strftime(buf, sizeof(buf),
+ (void)strftime(buf, sizeof(buf) - 1,
__CONCAT("%l:%","M%p"), localtime(nowp));
+ buf[sizeof buf -1] = '\0';
(void)printf("%s ", buf);
/*