From: Kay Sievers Date: Tue, 12 Jul 2005 09:41:09 +0000 (+0200) Subject: ata_id: check for empty serial number X-Git-Tag: 064~15^2~9 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e03bce632196dea1f6b18885225b46daaba7fa30;p=systemd ata_id: check for empty serial number Signed-off-by: Kay Sievers --- diff --git a/extras/ata_id/ata_id.c b/extras/ata_id/ata_id.c index 34b1ccdf..54c3c29f 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);