Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/stat When asked for the string representation of a d...



details:   https://anonhg.NetBSD.org/src/rev/59b15e74b4e3
branches:  trunk
changeset: 532110:59b15e74b4e3
user:      atatat <atatat%NetBSD.org@localhost>
date:      Fri May 31 16:45:16 2002 +0000

description:
When asked for the string representation of a device that isn't
found by devname(3), don't report a "bad format"...just use "???"
instead.

diffstat:

 usr.bin/stat/stat.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (27 lines):

diff -r 84758790b102 -r 59b15e74b4e3 usr.bin/stat/stat.c
--- a/usr.bin/stat/stat.c       Fri May 31 16:18:48 2002 +0000
+++ b/usr.bin/stat/stat.c       Fri May 31 16:45:16 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: stat.c,v 1.2 2002/05/09 17:52:03 atatat Exp $ */
+/*     $NetBSD: stat.c,v 1.3 2002/05/31 16:45:16 atatat Exp $ */
 
 /*
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: stat.c,v 1.2 2002/05/09 17:52:03 atatat Exp $");
+__RCSID("$NetBSD: stat.c,v 1.3 2002/05/31 16:45:16 atatat Exp $");
 #endif
 
 #include <sys/types.h>
@@ -500,6 +500,8 @@
                    S_ISCHR(st->st_mode) ? S_IFCHR :
                    S_ISBLK(st->st_mode) ? S_IFBLK :
                    0U);
+               if (sdata == NULL)
+                       sdata = "???";
                if (hilo == HIGH_PIECE) {
                        data = major(data);
                        hilo = 0;



Home | Main Index | Thread Index | Old Index