diff options
-rw-r--r-- | extras/ata_id/ata_id.c | 2 | ||||
-rw-r--r-- | extras/scsi_id/scsi_id.c | 2 | ||||
-rw-r--r-- | extras/usb_id/usb_id.c | 2 | ||||
-rw-r--r-- | extras/volume_id/vol_id.c | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/extras/ata_id/ata_id.c b/extras/ata_id/ata_id.c index 2840e91457..9579db3105 100644 --- a/extras/ata_id/ata_id.c +++ b/extras/ata_id/ata_id.c @@ -68,7 +68,7 @@ static void set_str(char *to, const char *from, size_t count) /* strip trailing whitespace */ len = strnlen(from, count); - while (isspace(from[len-1])) + while (len && isspace(from[len-1])) len--; /* strip leading whitespace */ diff --git a/extras/scsi_id/scsi_id.c b/extras/scsi_id/scsi_id.c index a46d1b377d..a86b004709 100644 --- a/extras/scsi_id/scsi_id.c +++ b/extras/scsi_id/scsi_id.c @@ -107,7 +107,7 @@ static void set_str(char *to, const char *from, size_t count) /* strip trailing whitespace */ len = strnlen(from, count); - while (isspace(from[len-1])) + while (len && isspace(from[len-1])) len--; /* strip leading whitespace */ diff --git a/extras/usb_id/usb_id.c b/extras/usb_id/usb_id.c index f5ee795924..c4ce0c6103 100644 --- a/extras/usb_id/usb_id.c +++ b/extras/usb_id/usb_id.c @@ -82,7 +82,7 @@ static void set_str(char *to, const char *from, size_t count) /* strip trailing whitespace */ len = strnlen(from, count); - while (isspace(from[len-1])) + while (len && isspace(from[len-1])) len--; /* strip leading whitespace */ diff --git a/extras/volume_id/vol_id.c b/extras/volume_id/vol_id.c index 6a9d1120e0..fe0b3a0ed0 100644 --- a/extras/volume_id/vol_id.c +++ b/extras/volume_id/vol_id.c @@ -66,7 +66,7 @@ static void set_str(char *to, const char *from, size_t count) /* strip trailing whitespace */ len = strnlen(from, count); - while (isspace(from[len-1])) + while (len && isspace(from[len-1])) len--; /* strip leading whitespace */ |