syslinux_dump_memmap(): make it easier to spot errors
authorH. Peter Anvin <hpa@zytor.com>
Sun, 3 May 2009 00:00:38 +0000 (17:00 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Sun, 3 May 2009 00:00:38 +0000 (17:00 -0700)
Instead of stopping the memmap dump on SMT_END, stop it only on a null
pointer.  That way we can see if we have any bogus entries with
SMT_END.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
com32/lib/syslinux/dump_mmap.c

index 87b894a..90ab840 100644 (file)
@@ -40,7 +40,7 @@ void syslinux_dump_memmap(FILE *file, struct syslinux_memmap *memmap)
   fprintf(file, "%10s %10s %10s\n"
          "--------------------------------\n",
          "Start", "Length", "Type");
-  while (memmap->type != SMT_END) {
+  while (memmap->next) {
     fprintf(file, "0x%08x 0x%08x %10d\n", memmap->start,
            memmap->next->start - memmap->start, memmap->type);
     memmap = memmap->next;