]> git.cameronkatri.com Git - snaprestore.git/commitdiff
Fix build main
authorCameron Katri <me@cameronkatri.com>
Tue, 31 May 2022 02:34:27 +0000 (22:34 -0400)
committerCameron Katri <me@cameronkatri.com>
Tue, 31 May 2022 02:34:27 +0000 (22:34 -0400)
src/snaprestore.m

index f32071d5c8d5d2e4eff6d33d839bed772a9354e4..8a10b60877400c53fde2258f22009af50e8f4d56 100644 (file)
@@ -28,7 +28,7 @@ void usage(char *name) {
 }
 
 NSString *bootsnapshot() {
 }
 
 NSString *bootsnapshot() {
-       NSMutableString *outString = @"com.apple.os.update-";
+       NSMutableString *outString = [@"com.apple.os.update-" mutableCopy];
        const UInt8 *bytes;
        CFIndex length;
        CFDataRef manifestHash, rootSnapshotName;
        const UInt8 *bytes;
        CFIndex length;
        CFDataRef manifestHash, rootSnapshotName;
@@ -38,7 +38,7 @@ NSString *bootsnapshot() {
        rootSnapshotName = IORegistryEntryCreateCFProperty(chosen, CFSTR("root-snapshot-name"), kCFAllocatorDefault, 0);
 
        if (rootSnapshotName != NULL && CFGetTypeID(rootSnapshotName) == CFDataGetTypeID()) {
        rootSnapshotName = IORegistryEntryCreateCFProperty(chosen, CFSTR("root-snapshot-name"), kCFAllocatorDefault, 0);
 
        if (rootSnapshotName != NULL && CFGetTypeID(rootSnapshotName) == CFDataGetTypeID()) {
-               CFStringRef snapshotString = CFStringCreateFromExternalRepresentation(kCFAllocatorDefault, rootSnapshotName, kCFStringE      ncodingUTF8);
+               CFStringRef snapshotString = CFStringCreateFromExternalRepresentation(kCFAllocatorDefault, rootSnapshotName, kCFStringEncodingUTF8);
                CFRelease(rootSnapshotName);
                char buffer[100];
                const char *ptr = CFStringGetCStringPtr(snapshotString, kCFStringEncodingUTF8);
                CFRelease(rootSnapshotName);
                char buffer[100];
                const char *ptr = CFStringGetCStringPtr(snapshotString, kCFStringEncodingUTF8);
@@ -53,7 +53,7 @@ NSString *bootsnapshot() {
 
                if (manifestHash == NULL || CFGetTypeID(manifestHash) != CFDataGetTypeID()) {
                        fprintf(stderr, "Unable to read boot-manifest-hash or root-snapshot-name\n");
 
                if (manifestHash == NULL || CFGetTypeID(manifestHash) != CFDataGetTypeID()) {
                        fprintf(stderr, "Unable to read boot-manifest-hash or root-snapshot-name\n");
-                       return 1;
+                       exit(1);
                }
 
                length = CFDataGetLength(manifestHash);
                }
 
                length = CFDataGetLength(manifestHash);