diff --git a/sbin/savecore/savecore.c b/sbin/savecore/savecore.c index 33b6fc31d4c7..9d17d090d435 100644 --- a/sbin/savecore/savecore.c +++ b/sbin/savecore/savecore.c @@ -101,7 +101,7 @@ struct nlist dump_nl[] = { /* Name list for dumped system. */ /* Types match kernel declarations. */ off_t dumplo; /* where dump starts on dumpdev */ int dumpmag; /* magic number in dump */ -int dumpsize; /* amount of memory dumped */ +off_t dumpsize; /* amount of memory dumped */ char *kernel; char *dirname; /* directory to save dumps in */ @@ -536,10 +536,12 @@ get_crashtime() void get_dumpsize() { + unsigned int dumppages; + /* Read the dump size. */ Lseek(dumpfd, (off_t)(dumplo + ok(dump_nl[X_DUMPSIZE].n_value)), L_SET); - (void)Read(dumpfd, &dumpsize, sizeof(dumpsize)); - dumpsize *= getpagesize(); + (void)Read(dumpfd, &dumppages, sizeof(dumppages)); + dumpsize = dumppages * getpagesize(); } int