summaryrefslogtreecommitdiff
path: root/os2/dl_os2.c
diff options
context:
space:
mode:
authorIlya Zakharevich <ilya@math.berkeley.edu>2001-06-28 12:03:14 -0400
committerJarkko Hietaniemi <jhi@iki.fi>2001-06-28 19:10:54 +0000
commit35bc1fdc44cabda9b94bf3b2cbffe0be67fef25d (patch)
treece362683cbc25c281c69b49928a386e14df2dd92 /os2/dl_os2.c
parent531b886104fed3302a6d671985aba5e2f6420dd5 (diff)
downloadperl-35bc1fdc44cabda9b94bf3b2cbffe0be67fef25d.tar.gz
OS/2 improvements
Message-ID: <20010628160314.A17906@math.ohio-state.edu> p4raw-id: //depot/perl@11010
Diffstat (limited to 'os2/dl_os2.c')
-rw-r--r--os2/dl_os2.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/os2/dl_os2.c b/os2/dl_os2.c
index aaeeb580f4..5c8b6e6871 100644
--- a/os2/dl_os2.c
+++ b/os2/dl_os2.c
@@ -11,18 +11,21 @@ static char fail[300];
char *os2error(int rc);
void *
-dlopen(char *path, int mode)
+dlopen(const char *path, int mode)
{
HMODULE handle;
char tmp[260], *beg, *dot;
ULONG rc;
fail[0] = 0;
- if ((rc = DosLoadModule(fail, sizeof fail, path, &handle)) == 0)
+ if ((rc = DosLoadModule(fail, sizeof fail, (char*)path, &handle)) == 0)
return (void *)handle;
retcode = rc;
+ if (strlen(path) >= sizeof(tmp))
+ return NULL;
+
/* Not found. Check for non-FAT name and try truncated name. */
/* Don't know if this helps though... */
for (beg = dot = path + strlen(path);
@@ -32,6 +35,7 @@ dlopen(char *path, int mode)
dot = beg;
if (dot - beg > 8) {
int n = beg+8-path;
+
memmove(tmp, path, n);
memmove(tmp+n, dot, strlen(dot)+1);
if (DosLoadModule(fail, sizeof fail, tmp, &handle) == 0)
@@ -42,7 +46,7 @@ dlopen(char *path, int mode)
}
void *
-dlsym(void *handle, char *symbol)
+dlsym(void *handle, const char *symbol)
{
ULONG rc, type;
PFN addr;