* 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
This commit is contained in:
parent
ca7c9ff157
commit
3de0d32a54
|
@ -231,14 +231,13 @@ static void Load_Lib (Object libs) {
|
||||||
if (eol == NULL || eol == dlname)
|
if (eol == NULL || eol == dlname)
|
||||||
continue;
|
continue;
|
||||||
*eol = '\0';
|
*eol = '\0';
|
||||||
path = strdup (STRING(PORT(port)->name)->data);
|
path = Get_String (PORT(port)->name);
|
||||||
eol = strrchr (path, SEPARATOR_CHAR);
|
eol = strrchr (path, SEPARATOR_CHAR);
|
||||||
if (eol == NULL)
|
if (eol == NULL)
|
||||||
eol = path;
|
eol = path;
|
||||||
*eol = '\0';
|
*eol = '\0';
|
||||||
lib = malloc (strlen (path) + 1 + strlen (dlname) + 1);
|
lib = malloc (strlen (path) + 1 + strlen (dlname) + 1);
|
||||||
sprintf (lib, "%s" SEPARATOR_STRING "%s", path, dlname);
|
sprintf (lib, "%s" SEPARATOR_STRING "%s", path, dlname);
|
||||||
free (path);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
(void)P_Close_Input_Port (port);
|
(void)P_Close_Input_Port (port);
|
||||||
|
|
Loading…
Reference in New Issue