Stop adding an extra null terminator to strings, OF_getprop already returns
a null terminated string.
This commit is contained in:
parent
d555ff6357
commit
f0f0917197
@ -401,10 +401,9 @@ mv_twsi_attach(device_t dev)
|
||||
for (child = OF_child(ofw_bus_get_node(dev)); child != 0;
|
||||
child = OF_peer(child)) {
|
||||
len = OF_getproplen(child, "model");
|
||||
if (len <= 0 || len > sizeof(dname) - 1)
|
||||
if (len <= 0 || len > sizeof(dname))
|
||||
continue;
|
||||
error = OF_getprop(child, "model", &dname, len);
|
||||
dname[len + 1] = '\0';
|
||||
if (error == -1)
|
||||
continue;
|
||||
len = strlen(dname);
|
||||
@ -428,10 +427,9 @@ mv_twsi_attach(device_t dev)
|
||||
|
||||
/* Get device driver name. */
|
||||
len = OF_getproplen(child, "model");
|
||||
if (len <= 0 || len > sizeof(dname) - 1)
|
||||
if (len <= 0 || len > sizeof(dname))
|
||||
continue;
|
||||
OF_getprop(child, "model", &dname, len);
|
||||
dname[len + 1] = '\0';
|
||||
|
||||
if (bootverbose)
|
||||
device_printf(dev, "adding a device %s at %d.\n",
|
||||
|
Loading…
x
Reference in New Issue
Block a user