diff options
author | Alan Brault <alan.brault@incruentatus.net> | 2010-12-07 21:07:02 -0500 |
---|---|---|
committer | Alan Brault <alan.brault@incruentatus.net> | 2010-12-07 21:07:02 -0500 |
commit | 4455eee4768796782b5842223647f7d1c8d085bb (patch) | |
tree | 5e2fc0a7671dea9847f56d58c002fac358922fe2 /src/bus.c | |
parent | d3c784283fe6d4eac879e1f3e084b18ee2af7fa2 (diff) | |
parent | 755866fee7ea4a6c2871a95fa9081656fb5bef23 (diff) | |
download | NetNuke2-4455eee4768796782b5842223647f7d1c8d085bb.tar.gz |
Merge branch 'master' of git://github.com/jhunkeler/NetNuke
Diffstat (limited to 'src/bus.c')
-rw-r--r-- | src/bus.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -80,8 +80,8 @@ int scanbus_sysfs(nndevice_t** device) } else { - fgets(device[i]->model, sizeof(device[i]->model), fp); - device[i]->model[strlen(device[i]->model) - 1] = 0; + if(fgets(device[i]->model, sizeof(device[i]->model), fp) != NULL) + device[i]->model[strlen(device[i]->model) - 1] = 0; fclose(fp); } @@ -95,10 +95,11 @@ int scanbus_sysfs(nndevice_t** device) } else { - fgets(device[i]->vendor, sizeof(device[i]->model), fp); - /* Why does sysfs not terminate the string after the last character? Kernel 2.6 bug? + /* Why does sysfs not terminate the string after the last character? Kernel 2.6 bug? Here we are checking for the space character and terminating it manually. */ - device[i]->vendor[strind(device[i]->vendor, ' ')] = 0; + if((fgets(device[i]->vendor, sizeof(device[i]->model), fp)) != NULL) + device[i]->vendor[strind(device[i]->vendor, ' ')] = 0; + fclose(fp); } |