Lengthened the maximum filename to 100 chars
[fw/sdcc] / link / z80 / lklibr.c
index bc10c17246b605d5da96953b127aa1ca19108c0b..7fd9f3defcbbbcdb0eb846961a77ede0fb769df9 100644 (file)
@@ -21,9 +21,8 @@
 
 #include <stdio.h>
 #include <string.h>
-//#include <alloc.h>
+#include <stdlib.h>
 #include "aslink.h"
-#include "newalloc.h"
 
 /*)Module      lklibr.c
  *
@@ -60,8 +59,8 @@ struct slibraryfile {
        int loaded;
        char *libspc;
        char *str;
-       char relfil[80];
-       char filename[80];
+       char relfil[FILSPC];
+       char filename[FILSPC];
        pmlibrarysymbol symbols;
        pmlibraryfile next;
 };
@@ -399,9 +398,7 @@ search()
 #ifdef INDEXLIB
 
 /* First entry in the library object symbol cache */
-mlibraryfile libr = {
-      0, "", NULL, NULL
-};
+mlibraryfile libr;
 
 int fndsym( char *name )
 {
@@ -481,7 +478,7 @@ int buildlibraryindex()
                                relfil[NINPUT+1] = '\0';
                                relfil[strlen(relfil) - 1] = '\0';
                                if (path != NULL) {
-                                       str = (char *)Safe_malloc(strlen(path)+strlen(relfil)+6);
+                                       str = (char *)new(strlen(path)+strlen(relfil)+6);
                                        strcpy(str,path);
 #ifdef OTHERSYSTEM
 #ifdef SDK
@@ -499,7 +496,7 @@ int buildlibraryindex()
                                        }
 #endif
                                } else {
-                                       str = (char *)Safe_malloc(strlen(relfil) + 5);
+                                       str = (char *)new(strlen(relfil) + 5);
                                }
 #ifdef SDK
 #ifdef UNIX
@@ -524,7 +521,7 @@ int buildlibraryindex()
 /*3*/                          if ((fp = fopen(str, "r")) != NULL) {
 
                                        /* Opened OK - create a new libraryfile object for it */
-                                       This->next = (pmlibraryfile)Safe_malloc( sizeof( mlibraryfile ));
+                                       This->next = (pmlibraryfile)new( sizeof( mlibraryfile ));
                                        if (This->next == NULL) {
                                                printf("panic: cant allocate memory.\n");
                                                exit(-1);