]> err.no Git - systemd/commitdiff
ata_id: check for empty serial number
authorKay Sievers <kay.sievers@suse.de>
Tue, 12 Jul 2005 09:41:09 +0000 (11:41 +0200)
committerKay Sievers <kay.sievers@suse.de>
Tue, 12 Jul 2005 09:41:09 +0000 (11:41 +0200)
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
extras/ata_id/ata_id.c

index 34b1ccdff1203be22f444626ef9ad63879fab7a4..54c3c29feb071966cb17d0bec746543f01820252 100644 (file)
@@ -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);