diff options
author | andrew <andrew@FreeBSD.org> | 2016-02-12 17:04:03 +0000 |
---|---|---|
committer | andrew <andrew@FreeBSD.org> | 2016-02-12 17:04:03 +0000 |
commit | f0f0917197fdd5b1e42ac095fb3e7a45097369f5 (patch) | |
tree | 11aff2bcb2232972c43b98a112d3cb32c1262f01 /sys/arm/mv | |
parent | d555ff63575749e553247e9c75fa9057c86200df (diff) | |
download | FreeBSD-src-f0f0917197fdd5b1e42ac095fb3e7a45097369f5.zip FreeBSD-src-f0f0917197fdd5b1e42ac095fb3e7a45097369f5.tar.gz |
Stop adding an extra null terminator to strings, OF_getprop already returns
a null terminated string.
Diffstat (limited to 'sys/arm/mv')
-rw-r--r-- | sys/arm/mv/twsi.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/arm/mv/twsi.c b/sys/arm/mv/twsi.c index dfd0243..bd9b137 100644 --- a/sys/arm/mv/twsi.c +++ b/sys/arm/mv/twsi.c @@ -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", |