]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
plugins/micron-nvme: Use correct print format specifier for sizeof arguments
authorDaniel Wagner <dwagner@suse.de>
Fri, 23 Sep 2022 14:28:19 +0000 (16:28 +0200)
committerDaniel Wagner <dwagner@suse.de>
Fri, 23 Sep 2022 14:29:55 +0000 (16:29 +0200)
Signed-off-by: Daniel Wagner <dwagner@suse.de>
plugins/micron/micron-nvme.c

index 90f03a27747d623fddd872f8dcf8d7661f2dda23..e6f3a8cfc2254193451607bf0f71ed6ddaf2849c 100644 (file)
@@ -2963,7 +2963,7 @@ static int get_common_log(int fd, uint8_t id, uint8_t **buf, int *size)
     if (hdr.log_size == sizeof(hdr)) {
         buffer = (uint8_t *)malloc(sizeof(hdr));
        if (buffer == NULL) {
-            fprintf(stderr, "malloc of %lu bytes failed for log: 0x%X\n",
+            fprintf(stderr, "malloc of %zu bytes failed for log: 0x%X\n",
                            sizeof(hdr), id);
            return -ENOMEM;
        }
@@ -2971,7 +2971,7 @@ static int get_common_log(int fd, uint8_t id, uint8_t **buf, int *size)
     } else if (hdr.log_size < hdr.max_size) {
        buffer = (uint8_t *)malloc(sizeof(hdr) + hdr.log_size);
        if (buffer == NULL) {
-            fprintf(stderr, "malloc of %lu bytes failed for log: 0x%X\n",
+            fprintf(stderr, "malloc of %zu bytes failed for log: 0x%X\n",
                            hdr.log_size + sizeof(hdr), id);
            return -ENOMEM;
        }
@@ -2989,7 +2989,7 @@ static int get_common_log(int fd, uint8_t id, uint8_t **buf, int *size)
         */
        buffer = (uint8_t *)malloc(hdr.max_size + sizeof(hdr));
        if (buffer == NULL) {
-            fprintf(stderr, "malloc of %lu bytes failed for log: 0x%X\n",
+            fprintf(stderr, "malloc of %zu bytes failed for log: 0x%X\n",
                            hdr.max_size + sizeof(hdr), id);
            return -ENOMEM;
        }