mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-15 09:44:04 +00:00
Modify last commit to keep compiler happy since it claims devbuf can never be null (should we really trust gcc that much?)
This commit is contained in:
parent
44a4ffae91
commit
9e5739e612
12
src/linux.c
12
src/linux.c
@ -2278,13 +2278,11 @@ void update_diskio(void)
|
|||||||
if (col_count == 5 && major != LVM_BLK_MAJOR && major != NBD_MAJOR
|
if (col_count == 5 && major != LVM_BLK_MAJOR && major != NBD_MAJOR
|
||||||
&& major != RAMDISK_MAJOR && major != LOOP_MAJOR) {
|
&& major != RAMDISK_MAJOR && major != LOOP_MAJOR) {
|
||||||
/* If the last character of the device is a digit we assume
|
/* If the last character of the device is a digit we assume
|
||||||
* it is a subdevice (needed for kernel > 2.6.31) */
|
* it is a subdevice (needed for kernel > 2.6.31) */
|
||||||
if (devbuf) {
|
len_devbuf = strlen(devbuf);
|
||||||
len_devbuf = strlen(devbuf);
|
if ((len_devbuf > 0) && !isdigit(devbuf[len_devbuf-1])) {
|
||||||
if ((len_devbuf > 0) && !isdigit(devbuf[len_devbuf-1])) {
|
total_reads += reads;
|
||||||
total_reads += reads;
|
total_writes += writes;
|
||||||
total_writes += writes;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
col_count = sscanf(buf, "%u %u %s %*u %u %*u %u",
|
col_count = sscanf(buf, "%u %u %s %*u %u %*u %u",
|
||||||
|
Loading…
Reference in New Issue
Block a user