mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 08:43:19 -04:00
devinfo sysctl handler: Do not write zero-length strings in to sbuf twice
This fixes missing PnPinfo and location strings in devinfo(8) output for devices with no attached drivers.
This commit is contained in:
parent
e54a1d5751
commit
e3dd8ed77b
1 changed files with 0 additions and 6 deletions
|
|
@ -5528,18 +5528,12 @@ sysctl_devices(SYSCTL_HANDLER_ARGS)
|
|||
sbuf_new(&sb, udev->dv_fields, sizeof(udev->dv_fields), SBUF_FIXEDLEN);
|
||||
if (dev->nameunit != NULL)
|
||||
sbuf_cat(&sb, dev->nameunit);
|
||||
else
|
||||
sbuf_putc(&sb, '\0');
|
||||
sbuf_putc(&sb, '\0');
|
||||
if (dev->desc != NULL)
|
||||
sbuf_cat(&sb, dev->desc);
|
||||
else
|
||||
sbuf_putc(&sb, '\0');
|
||||
sbuf_putc(&sb, '\0');
|
||||
if (dev->driver != NULL)
|
||||
sbuf_cat(&sb, dev->driver->name);
|
||||
else
|
||||
sbuf_putc(&sb, '\0');
|
||||
sbuf_putc(&sb, '\0');
|
||||
bus_child_pnpinfo_sb(dev, &sb);
|
||||
sbuf_putc(&sb, '\0');
|
||||
|
|
|
|||
Loading…
Reference in a new issue