fix format string in loadLibrary call to snprintf

"%*s" means "at least", whereas "%.*s" means at most, and the latter
is what I intended.  This only became noticable as of 9f22a70, when I
added another directory to the library path, which caused loadLibrary
to fail to find libraries in either directory.
This commit is contained in:
Joel Dice 2013-02-08 08:24:06 -07:00
parent ce9d7c35bb
commit f9b3be0301

View File

@ -221,7 +221,7 @@ loadLibrary(Thread* t, const char* path, const char* name, bool mapName,
THREAD_RUNTIME_ARRAY(t, char, fullName, fullNameLength + 1); THREAD_RUNTIME_ARRAY(t, char, fullName, fullNameLength + 1);
snprintf(RUNTIME_ARRAY_BODY(fullName), fullNameLength + 1, snprintf(RUNTIME_ARRAY_BODY(fullName), fullNameLength + 1,
"%*s/%s", token.length, token.s, name); "%.*s/%s", token.length, token.s, name);
lib = loadLibrary(t, RUNTIME_ARRAY_BODY(fullName)); lib = loadLibrary(t, RUNTIME_ARRAY_BODY(fullName));
if (lib) break; if (lib) break;