Make sure first argument is an int when using %.*s to print e.g. chunks

This commit is contained in:
Tobias Brunner
2012-09-28 18:01:49 +02:00
parent 4bc24ba794
commit a05f3b2021
17 changed files with 52 additions and 46 deletions
+4 -2
View File
@@ -106,14 +106,16 @@ static void build_binary_checksum(char *path)
pos = strrchr(binary, '.');
if (pos && streq(pos, ".so"))
{
snprintf(name, sizeof(name), "%.*s\",", pos - binary, binary);
snprintf(name, sizeof(name), "%.*s\",", (int)(pos - binary),
binary);
if (streq(name, "libstrongswan\","))
{
snprintf(sname, sizeof(sname), "%s", "library_init");
}
else
{
snprintf(sname, sizeof(sname), "%.*s_init", pos - binary, binary);
snprintf(sname, sizeof(sname), "%.*s_init", (int)(pos - binary),
binary);
}
build_checksum(path, name, sname);
}