From 88590ddcfefdb94f2900282ec8b7a9573b53d37f Mon Sep 17 00:00:00 2001 From: Jari Vetoniemi Date: Tue, 15 Apr 2014 20:14:42 +0300 Subject: [PATCH] Don't use the enumerator variable. --- lib/draw/curses.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/draw/curses.c b/lib/draw/curses.c index 0f6fdd2..82fd194 100644 --- a/lib/draw/curses.c +++ b/lib/draw/curses.c @@ -403,15 +403,15 @@ static void _bmDrawCursesResizeHandler(int sig) int _bmDrawCursesInit(struct _bmRenderApi *api) { memset(&curses, 0, sizeof(curses)); + const char *lib = NULL, *func = NULL; unsigned int i; for (i = 0; DL_PATH[i] && !curses.handle; ++i) - curses.handle = dlopen(DL_PATH[i], RTLD_LAZY); + curses.handle = dlopen((lib = DL_PATH[i]), RTLD_LAZY); if (!curses.handle) return 0; - char *func = NULL; #define bmLoadFunction(x) (curses.x = dlsym(curses.handle, (func = #x))) if (!bmLoadFunction(initscr)) @@ -473,7 +473,7 @@ int _bmDrawCursesInit(struct _bmRenderApi *api) return 1; function_pointer_exception: - fprintf(stderr, "-!- Could not load function '%s' from '%s'\n", func, DL_PATH[i]); + fprintf(stderr, "-!- Could not load function '%s' from '%s'\n", func, lib); _bmDrawCursesFree(); return 0; }