From 5374c8f035ff23c598580c8cd394e441054b5cbd Mon Sep 17 00:00:00 2001 From: tudnai Date: Thu, 25 Jun 2020 16:33:15 -0700 Subject: [PATCH] Fixed WOZ file save --- .../trudnai.xcuserdatad/xcdebugger/Expressions.xcexplist | 8 ++++++++ A2Mac/AppDelegate.swift | 2 +- src/dev/disk/woz.c | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/A2Mac.xcodeproj/project.xcworkspace/xcuserdata/trudnai.xcuserdatad/xcdebugger/Expressions.xcexplist b/A2Mac.xcodeproj/project.xcworkspace/xcuserdata/trudnai.xcuserdatad/xcdebugger/Expressions.xcexplist index 34c828c..adccabb 100644 --- a/A2Mac.xcodeproj/project.xcworkspace/xcuserdata/trudnai.xcuserdatad/xcdebugger/Expressions.xcexplist +++ b/A2Mac.xcodeproj/project.xcworkspace/xcuserdata/trudnai.xcuserdatad/xcdebugger/Expressions.xcexplist @@ -114,6 +114,14 @@ + + + + + + diff --git a/A2Mac/AppDelegate.swift b/A2Mac/AppDelegate.swift index e85ceaf..771f15e 100644 --- a/A2Mac/AppDelegate.swift +++ b/A2Mac/AppDelegate.swift @@ -53,7 +53,7 @@ class AppDelegate: NSObject, NSApplicationDelegate { let savePanel = NSSavePanel() savePanel.begin { (result) in if result.rawValue == NSApplication.ModalResponse.OK.rawValue { - woz_saveFile( savePanel.url?.absoluteString ); + woz_saveFile( savePanel.url?.path ); } } diff --git a/src/dev/disk/woz.c b/src/dev/disk/woz.c index 524b932..cc26943 100644 --- a/src/dev/disk/woz.c +++ b/src/dev/disk/woz.c @@ -554,7 +554,7 @@ int woz_saveFile( const char * filename ) { return WOZ_ERR_FILE_NOT_FOUND; } - fwrite( &woz_file_buffer, woz_file_size, 1, f ); + fwrite( woz_file_buffer, woz_file_size, 1, f ); fclose(f); return WOZ_ERR_OK;