Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/who Handle ctime() failure.
details: https://anonhg.NetBSD.org/src/rev/7ea311280d7a
branches: trunk
changeset: 796534:7ea311280d7a
user: mlelstv <mlelstv%NetBSD.org@localhost>
date: Sun Jun 08 09:53:43 2014 +0000
description:
Handle ctime() failure.
diffstat:
usr.bin/who/who.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diffs (36 lines):
diff -r 79767cfb14b8 -r 7ea311280d7a usr.bin/who/who.c
--- a/usr.bin/who/who.c Sun Jun 08 07:01:30 2014 +0000
+++ b/usr.bin/who/who.c Sun Jun 08 09:53:43 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: who.c,v 1.23 2008/07/24 15:35:41 christos Exp $ */
+/* $NetBSD: who.c,v 1.24 2014/06/08 09:53:43 mlelstv Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -42,7 +42,7 @@
#if 0
static char sccsid[] = "@(#)who.c 8.1 (Berkeley) 6/6/93";
#endif
-__RCSID("$NetBSD: who.c,v 1.23 2008/07/24 15:35:41 christos Exp $");
+__RCSID("$NetBSD: who.c,v 1.24 2014/06/08 09:53:43 mlelstv Exp $");
#endif /* not lint */
#include <sys/types.h>
@@ -285,6 +285,7 @@
time_t idle;
const char *types = NULL;
size_t i;
+ char *tstr;
state = '?';
idle = 0;
@@ -312,7 +313,8 @@
(void)printf("%c ", state);
(void)printf("%-*.*s ", maxline, maxline, line);
- (void)printf("%.12s ", ctime(&t) + 4);
+ tstr = ctime(&t);
+ (void)printf("%.12s ", tstr ? tstr + 4 : "?");
if (show_idle) {
if (idle < 60)
Home |
Main Index |
Thread Index |
Old Index