diff options
| author | Mark Johnston <markj@FreeBSD.org> | 2014-10-22 23:35:56 +0000 |
|---|---|---|
| committer | Mark Johnston <markj@FreeBSD.org> | 2014-10-22 23:35:56 +0000 |
| commit | d4fef7d3422759b8c6177ae5e76f3ff95d7a3dc9 (patch) | |
| tree | cff95f41c96f2bf5d2177969298658a041245490 /usr.sbin/pciconf | |
| parent | b9f6af45a597e5b1faaa9aca9afaf14fbdd5bf7a (diff) | |
Notes
Diffstat (limited to 'usr.sbin/pciconf')
| -rw-r--r-- | usr.sbin/pciconf/pciconf.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/pciconf/pciconf.c b/usr.sbin/pciconf/pciconf.c index 12e83ec93380..22bb61dacaf1 100644 --- a/usr.sbin/pciconf/pciconf.c +++ b/usr.sbin/pciconf/pciconf.c @@ -662,16 +662,16 @@ getdevice(const char *name) * find the start of the unit. */ if (name[0] == '\0') - err(1, "Empty device name"); + errx(1, "Empty device name"); cp = strchr(name, '\0'); assert(cp != NULL && cp != name); cp--; while (cp != name && isdigit(cp[-1])) cp--; - if (cp == name) + if (cp == name || !isdigit(*cp)) errx(1, "Invalid device name"); if ((size_t)(cp - name) + 1 > sizeof(patterns[0].pd_name)) - errx(1, "Device name i2s too long"); + errx(1, "Device name is too long"); memcpy(patterns[0].pd_name, name, cp - name); patterns[0].pd_unit = strtol(cp, &cp, 10); assert(*cp == '\0'); |
