diff --git a/cmd/ubi.c b/cmd/ubi.c
index 0e935e34b8e626fb5ec916109ae013aee07e3048..913f0f71fd99b83dab958bc5620e62a1af3c6487 100644
--- a/cmd/ubi.c
+++ b/cmd/ubi.c
@@ -356,7 +356,7 @@ int ubi_volume_read(char *volume, char *buf, size_t size)
 		size = vol->used_bytes;
 	}
 
-	printf("Read %u bytes from volume %s to %p\n", size, volume, buf);
+	printf("Read %zu bytes from volume %s to %p\n", size, volume, buf);
 
 	if (vol->corrupted)
 		printf("read from corrupted volume %d", vol->vol_id);