diff options
| author | christos <christos@NetBSD.org> | 2010-04-01 22:23:27 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2010-04-01 22:23:27 +0000 |
| commit | 221f2e33ddee577155a353cb0db179ae47bd3d37 (patch) | |
| tree | 3f0436023f4d9d1d0f592d11f47710013095aace /bin | |
| parent | ea2a1a36314f8b028cb01c8b231ab82df6e174ad (diff) | |
handle ctime returning NULL
Diffstat (limited to 'bin')
| -rw-r--r-- | bin/ls/print.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/bin/ls/print.c b/bin/ls/print.c index 6b6e625f524..2d0e1762b17 100644 --- a/bin/ls/print.c +++ b/bin/ls/print.c @@ -1,4 +1,4 @@ -/* $NetBSD: print.c,v 1.45 2009/02/14 08:02:04 lukem Exp $ */ +/* $NetBSD: print.c,v 1.46 2010/04/01 22:23:27 christos Exp $ */ /* * Copyright (c) 1989, 1993, 1994 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)print.c 8.5 (Berkeley) 7/28/94"; #else -__RCSID("$NetBSD: print.c,v 1.45 2009/02/14 08:02:04 lukem Exp $"); +__RCSID("$NetBSD: print.c,v 1.46 2010/04/01 22:23:27 christos Exp $"); #endif #endif /* not lint */ @@ -353,9 +353,13 @@ static void printtime(time_t ftime) { int i; - char *longstring; + const char *longstring; longstring = ctime(&ftime); + if (longstring == NULL) { + /* 012345678901234567890123 */ + longstring = "????????????????????????"; + } for (i = 4; i < 11; ++i) (void)putchar(longstring[i]); |
