diff options
| author | mrg <mrg@NetBSD.org> | 2009-05-18 05:51:53 +0000 |
|---|---|---|
| committer | mrg <mrg@NetBSD.org> | 2009-05-18 05:51:53 +0000 |
| commit | b71ffbf87a45eb085e974cf01dcf4ab4819059e2 (patch) | |
| tree | 87b9842849f9f660a64f169e7f1a197ef8dcd0e2 /usr.sbin/ofctl | |
| parent | 07b81fef7ee005f8795d8261084b9cc6c595308e (diff) | |
if there is no "name" properly, don't assert(), pretend it is empty.
now "ofctl" works on the shark. fixes PR#36733.
Diffstat (limited to 'usr.sbin/ofctl')
| -rw-r--r-- | usr.sbin/ofctl/ofctl.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.sbin/ofctl/ofctl.c b/usr.sbin/ofctl/ofctl.c index 913b476a98a..04706287825 100644 --- a/usr.sbin/ofctl/ofctl.c +++ b/usr.sbin/ofctl/ofctl.c @@ -1,4 +1,4 @@ -/* $NetBSD: ofctl.c,v 1.10 2009/04/26 04:54:27 lukem Exp $ */ +/* $NetBSD: ofctl.c,v 1.11 2009/05/18 05:51:53 mrg Exp $ */ /*- * Copyright (c) 2006, 2007 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ #ifndef lint __COPYRIGHT("@(#) Copyright (c) 2006, 2007\ The NetBSD Foundation, Inc. All rights reserved."); -__RCSID("$NetBSD: ofctl.c,v 1.10 2009/04/26 04:54:27 lukem Exp $"); +__RCSID("$NetBSD: ofctl.c,v 1.11 2009/05/18 05:51:53 mrg Exp $"); #endif /* not lint */ #include <stdio.h> @@ -564,7 +564,8 @@ ofname(int node, char *buf, size_t buflen) int len; len = OF_getprop(node, "name", name, sizeof(name)); - assert(len > 0); + if (len <= 0) + name[0] = '\0'; off += snprintf(buf + off, buflen - off, "/%s", name); reglen = OF_getprop(node, "reg", reg_buf, sizeof(reg_buf)); |
