Merged some lemon diffs from sqlite's fossil repo: Visual Studio compile fixes.
authorRyan C. Gordon <icculus@icculus.org>
Wed, 03 Mar 2010 09:13:26 -0800
changeset 884 7d3aad1c2569
parent 883 df6265a993bc
child 885 29b6d4c4a7a2
Merged some lemon diffs from sqlite's fossil repo: Visual Studio compile fixes.
misc/lemon.c
--- a/misc/lemon.c	Wed Mar 03 08:46:17 2010 -0800
+++ b/misc/lemon.c	Wed Mar 03 09:13:26 2010 -0800
@@ -51,7 +51,6 @@
         if (!successful_exit) {
             remove(made_files[i]);
         }
-        free((void *) made_files[i]);
     }
     free(made_files);
     made_files_count = 0;
@@ -408,7 +407,7 @@
     rc = ap1->x.rp->index - ap2->x.rp->index;
   }
   if( rc==0 ){
-    rc = ap2 - ap1;
+    rc = (int) (ap2 - ap1);
   }
   return rc;
 }
@@ -2817,10 +2816,9 @@
   if(( *mode=='w' ) && (strcmp(suffix, ".out") != 0)){
     const char **ptr = (const char **)
         realloc(made_files, sizeof (const char **) * (made_files_count + 1));
-    char *fname = strdup(lemp->outname);
+    const char *fname = Strsafe(lemp->outname);
     if ((ptr == NULL) || (fname == NULL)) {
         free(ptr);
-        free(fname);
         memory_error();
     }
     made_files = ptr;