]> git.gag.com Git - fw/sdcc/blobdiff - as/hc08/lklibr.c
* support/regression/collate-results.py: fixed output in case of a valdiag error
[fw/sdcc] / as / hc08 / lklibr.c
index 8ca450486b0fa8d4d2bc36f259e2e10fd4ac72e7..eb33beafd1c498e6ba64f928f0fa5c1767db785a 100644 (file)
 #define EQ(A,B) !strcmp((A),(B))
 #define MAXLINE 254 /*when using fgets*/
 
-#if defined(__APPLE__) && defined(__MACH__)
-#include <sys/types.h>
-#include <sys/malloc.h>
-#else
-#include <malloc.h>
-#endif
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -243,7 +237,7 @@ int addfile(char * path, char * libfil)
         That way putting 'path' and 'libfil' together will result into the original filepath
         as contained in 'str'.*/
         int j;
-        path = (char *) new (strlen(str));
+        path = (char *) new (strlen(str) + 1);
         strcpy(path, str);
         for(j=strlen(path)-1; j>=0; j--)
         {