From 1b564a0ac8f6e2e88c35ccf69dce572fe902ca64 Mon Sep 17 00:00:00 2001 From: Apple Date: Fri, 19 Dec 2003 22:39:23 +0000 Subject: [PATCH] BootX-59.1.1.tar.gz --- bootx.tproj/sl.subproj/main.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/bootx.tproj/sl.subproj/main.c b/bootx.tproj/sl.subproj/main.c index e06392c..d1a1e6a 100644 --- a/bootx.tproj/sl.subproj/main.c +++ b/bootx.tproj/sl.subproj/main.c @@ -932,7 +932,8 @@ static long GetBootPaths(void) // Get just the partition number strncpy(gBootFile, gBootDevice + cnt + 1, cnt2 - cnt - 1); - partNum = atoi(gBootFile); + partNum = strtol(gBootFile, 0, 10); + if (partNum == 0) partNum = strtol(gBootFile, 0, 16); // Adjust the partition number. // Pass 0 & 1, no offset. Pass 2 & 3, offset 1, Pass 4 & 5, offset 2. @@ -942,18 +943,18 @@ static long GetBootPaths(void) strncpy(gBootFile, gBootDevice, cnt + 1); sprintf(gBootFile + cnt + 1, "%d,%s\\mach_kernel", partNum, ((gBootSourceNumber & 1) ? "" : "\\")); - + // and the cache file name - + bzero(gCacheNameAdler + 64, sizeof(gBootFile)); strcpy(gCacheNameAdler + 64, gBootFile); adler32 = Alder32(gCacheNameAdler, sizeof(gCacheNameAdler)); - + strncpy(gBootKernelCacheFile, gBootDevice, cnt + 1); sprintf(gBootKernelCacheFile + cnt + 1, "%d,\\System\\Library\\Caches\\com.apple.kernelcaches\\kernelcache.%08lX", partNum, adler32); break; - + default: printf("Failed to infer Boot Device Type.\n"); return -1; -- 2.47.2