Some scary fixes that came up at the last moment for ArmyOps 2.3.0's patch.
authorRyan C. Gordon <icculus@icculus.org>
Fri, 22 Apr 2005 09:59:45 +0000
changeset 78 55c90060fbc1
parent 77 809774c1e78d
child 79 592222bb0e6d
Some scary fixes that came up at the last moment for ArmyOps 2.3.0's patch.
platform_unix.c
ui_carbon.c
--- a/platform_unix.c	Wed Mar 23 22:21:32 2005 +0000
+++ b/platform_unix.c	Fri Apr 22 09:59:45 2005 +0000
@@ -553,11 +553,11 @@
 int spawn_xdelta(const char *cmdline)
 {
     const char *binname = "xdelta";
-    char *cmd = alloca(strlen(cmdline) + strlen(basedir) + strlen(binname) + 2);
+    char *cmd = alloca(strlen(cmdline) + strlen(basedir) + strlen(binname) + 5);
     if (!cmd)
         return(0);
 
-    sprintf(cmd, "\"%s%s\" %s", basedir, binname, cmdline);
+    sprintf(cmd, "\"%s/%s\" %s", basedir, binname, cmdline);
 
 #if !USE_PTHREAD
     int rc = 0;
--- a/ui_carbon.c	Wed Mar 23 22:21:32 2005 +0000
+++ b/ui_carbon.c	Fri Apr 22 09:59:45 2005 +0000
@@ -17,13 +17,14 @@
 {
     ControlID statusID = { MOJOPATCH_SIG, MOJOPATCH_STATUS_ID };
     ControlID progressID = { MOJOPATCH_SIG, MOJOPATCH_PROGRESS_ID };
-    IBNibRef nibRef;
+    IBNibRef nibRef = NULL;
     OSStatus err;
     Boolean b = TRUE;
 
     if (carbon_ui_initialized)  /* already initialized? */
         return(1);
 
+    /* !!! FIXME: This is corrupting the "basedir" variable in platform_unix.c ! */
     if (CreateNibReference(CFSTR("mojopatch"), &nibRef) != noErr)
     {
         fprintf(stderr, "MOJOPATCH: You probably don't have a .nib file!\n");