From d620ac6f0f075253857ed3203db2d7c89df629e9 Mon Sep 17 00:00:00 2001 From: Cesare Tirabassi Date: Sat, 30 Jan 2010 19:23:31 +0100 Subject: [PATCH] Modify last commit to keep compiler happy since it claims devbuf can never be null (should we really trust gcc that much?) --- src/linux.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/linux.c b/src/linux.c index 23f95fa..a229809 100644 --- a/src/linux.c +++ b/src/linux.c @@ -2278,13 +2278,11 @@ void update_diskio(void) if (col_count == 5 && major != LVM_BLK_MAJOR && major != NBD_MAJOR && major != RAMDISK_MAJOR && major != LOOP_MAJOR) { /* If the last character of the device is a digit we assume - * it is a subdevice (needed for kernel > 2.6.31) */ - if (devbuf) { - len_devbuf = strlen(devbuf); - if ((len_devbuf > 0) && !isdigit(devbuf[len_devbuf-1])) { - total_reads += reads; - total_writes += writes; - } + * it is a subdevice (needed for kernel > 2.6.31) */ + len_devbuf = strlen(devbuf); + if ((len_devbuf > 0) && !isdigit(devbuf[len_devbuf-1])) { + total_reads += reads; + total_writes += writes; } } else { col_count = sscanf(buf, "%u %u %s %*u %u %*u %u", -- 1.7.9.5