diff --git a/lib/library.cpp b/lib/library.cpp
index a69d1fcae..1fece701b 100644
--- a/lib/library.cpp
+++ b/lib/library.cpp
@@ -115,9 +115,9 @@ bool Library::load(const tinyxml2::XMLDocument &doc)
else if (strcmp(argnode->Name(), "not-uninit") == 0)
notuninit = true;
else if (strcmp(argnode->Name(), "formatstr") == 0)
- notuninit = true;
+ formatstr = true;
else if (strcmp(argnode->Name(), "strz") == 0)
- notuninit = true;
+ strz = true;
else
return false;
}
diff --git a/test/testlibrary.cpp b/test/testlibrary.cpp
index 9b742f689..74f958245 100644
--- a/test/testlibrary.cpp
+++ b/test/testlibrary.cpp
@@ -28,6 +28,7 @@ private:
void run() {
TEST_CASE(empty);
TEST_CASE(function);
+ TEST_CASE(function_arg);
TEST_CASE(memory);
}
@@ -61,6 +62,35 @@ private:
ASSERT(library.isnotnoreturn("foo"));
}
+ void function_arg() {
+ const char xmldata[] = "\n"
+ "\n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ "";
+ tinyxml2::XMLDocument doc;
+ doc.Parse(xmldata, sizeof(xmldata));
+
+ Library library;
+ library.load(doc);
+ ASSERT_EQUALS(true, library.argumentChecks["foo"][1].notuninit);
+ ASSERT_EQUALS(true, library.argumentChecks["foo"][2].notnull);
+ ASSERT_EQUALS(true, library.argumentChecks["foo"][3].formatstr);
+ ASSERT_EQUALS(true, library.argumentChecks["foo"][4].strz);
+ }
+
void memory() {
const char xmldata[] = "\n"
"\n"