From f9b3be03019202f56847e41682383d31fcd89b79 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Fri, 8 Feb 2013 08:24:06 -0700 Subject: [PATCH] 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. --- src/classpath-common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/classpath-common.h b/src/classpath-common.h index 47d11343ac..aff9f8c40c 100644 --- a/src/classpath-common.h +++ b/src/classpath-common.h @@ -221,7 +221,7 @@ loadLibrary(Thread* t, const char* path, const char* name, bool mapName, THREAD_RUNTIME_ARRAY(t, char, 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)); if (lib) break;