From 3d47027d3172db7233c694de99d690960b943ae4 Mon Sep 17 00:00:00 2001 From: Nick Briggs Date: Wed, 7 Jun 2017 20:50:30 -0700 Subject: [PATCH] Clean up error message for case where sysout is not integral number of pages. Correct format string (%lx) for size of argument (long). modified: ldsout.c --- src/ldsout.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ldsout.c b/src/ldsout.c index 60fd1b1..a891d8b 100644 --- a/src/ldsout.c +++ b/src/ldsout.c @@ -247,8 +247,9 @@ int sys_size; /* sysout size in megabytes */ machinetype = ifpage.machinetype; - if ((stat_buf.st_size & 0x1ff) != 0) - printf("CAUTION::sysout & 0x1ff = 0x%x\n", stat_buf.st_size & BYTESPER_PAGE); + if ((stat_buf.st_size & (BYTESPER_PAGE - 1)) != 0) + printf("CAUTION::not an integral number of pages. sysout & 0x1ff = 0x%x\n", + (int)(stat_buf.st_size & (BYTESPER_PAGE - 1))); if (ifpage.nactivepages != (sysout_size / 2)) { printf("sysout_loader:IFPAGE says sysout size is %d\n", ifpage.nactivepages); @@ -335,7 +336,7 @@ int sys_size; /* sysout size in megabytes */ lispworld_offset = GETFPTOVP(fptovp, i) * BYTESPER_PAGE; if (read(sysout, lispworld_scratch + lispworld_offset, BYTESPER_PAGE) == -1) { printf("sysout_loader: can't read sysout file at %d\n", i); - printf(" offset was 0x%x (0x%x pages).\n", lispworld_offset, + printf(" offset was 0x%lx (0x%x pages).\n", lispworld_offset, GETFPTOVP(fptovp, i)); perror("read() error was"); {