From 37ecd725e58c41820e01f15c1ef4fb2c07014aa9 Mon Sep 17 00:00:00 2001 From: Timo Schulz Date: Wed, 3 Nov 2004 20:03:46 +0000 Subject: 2004-11-03 Timo Schulz * strgutil.c (w32_strerror): New. * ttyio.c (init_ttyfp, tty_printf, do_get): Use it here. * iobuf.c (fd_cache_open, file_filter): Likewise. (iobuf_seek, translate_file_handle): Likewise. --- cipher/idea-stub.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'cipher/idea-stub.c') diff --git a/cipher/idea-stub.c b/cipher/idea-stub.c index efc5268d7..caff9f034 100644 --- a/cipher/idea-stub.c +++ b/cipher/idea-stub.c @@ -63,7 +63,7 @@ dlopen (const char *pathname, int mode) void *h = LoadLibrary (pathname); if (!h) { - log_error ("LoadLibrary failed ec=%d\n", (int)GetLastError()); + log_error ("LoadLibrary failed: %s\n", w32_strerror (errno)); last_error = 1; return NULL; } @@ -77,25 +77,22 @@ dlclose ( void *handle ) return FreeLibrary (handle); } -char* + +const char* dlerror (void) { - static char dlerrstr[10]; if (last_error) - { - sprintf(dlerrstr, "%d", (int)GetLastError() ); - return dlerrstr; - } + return w32_strerror (0); return NULL; } void* -dlsym ( void *handle, const char *name ) +dlsym (void *handle, const char *name) { void *h = GetProcAddress (handle, name); if (!h) { - log_error ("GetProcAddress failed ec=%d\n", (int)GetLastError()); + log_error ("GetProcAddress failed: %s\n", w32_strerror (errno)); last_error = 1; } return h; -- cgit v1.2.3