From 3de0d32a5450db9d718893e0458280595ede57c1 Mon Sep 17 00:00:00 2001 From: sam Date: Thu, 11 Mar 2004 18:21:55 +0000 Subject: [PATCH] * src/loadlib.c: + Use the internal Get_String() function to allocate a C string from library objects, since Elk strings are not null-terminated. git-svn-id: svn://svn.zoy.org/elk/trunk@250 55e467fa-43c5-0310-a8a2-de718669efc6 --- src/loadlib.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/loadlib.c b/src/loadlib.c index 06b9377..4508be2 100644 --- a/src/loadlib.c +++ b/src/loadlib.c @@ -231,14 +231,13 @@ static void Load_Lib (Object libs) { if (eol == NULL || eol == dlname) continue; *eol = '\0'; - path = strdup (STRING(PORT(port)->name)->data); + path = Get_String (PORT(port)->name); eol = strrchr (path, SEPARATOR_CHAR); if (eol == NULL) eol = path; *eol = '\0'; lib = malloc (strlen (path) + 1 + strlen (dlname) + 1); sprintf (lib, "%s" SEPARATOR_STRING "%s", path, dlname); - free (path); break; } (void)P_Close_Input_Port (port);