diff options
author | Kay Sievers <kay.sievers@suse.de> | 2005-07-12 11:41:09 +0200 |
---|---|---|
committer | Kay Sievers <kay.sievers@suse.de> | 2005-07-12 11:41:09 +0200 |
commit | e03bce632196dea1f6b18885225b46daaba7fa30 (patch) | |
tree | 1bf5dc931e9747cbbfc2a0b5747d7ba625c4a746 /extras/ata_id | |
parent | 4431072fb8a95005976cd3316fb978ef6fb588ca (diff) |
ata_id: check for empty serial number
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
Diffstat (limited to 'extras/ata_id')
-rw-r--r-- | extras/ata_id/ata_id.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/extras/ata_id/ata_id.c b/extras/ata_id/ata_id.c index 34b1ccdff1..54c3c29feb 100644 --- a/extras/ata_id/ata_id.c +++ b/extras/ata_id/ata_id.c @@ -167,8 +167,12 @@ int main(int argc, char *argv[]) printf("ID_MODEL=%s\n", model); printf("ID_SERIAL=%s\n", serial); printf("ID_REVISION=%s\n", revision); - } else - printf("%s_%s\n", model, serial); + } else { + if (serial[0] != '\0') + printf("%s_%s\n", model, serial); + else + printf("%s\n", model); + } close: close(fd); |