summaryrefslogtreecommitdiff
path: root/src/test/test_libconfig.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-12-26 02:28:59 +0100
committerHaru <haru@dotalux.com>2016-05-08 19:53:57 +0200
commit2349b2a1528fe5dc41d930f8dd332df5ba521eb6 (patch)
tree3656a91a896f0ef090606b2b4c9184ad73153a3f /src/test/test_libconfig.c
parent58a7bf46508b7f186704e7efb39576e09f0ab866 (diff)
downloadhercules-2349b2a1528fe5dc41d930f8dd332df5ba521eb6.tar.gz
hercules-2349b2a1528fe5dc41d930f8dd332df5ba521eb6.tar.bz2
hercules-2349b2a1528fe5dc41d930f8dd332df5ba521eb6.tar.xz
hercules-2349b2a1528fe5dc41d930f8dd332df5ba521eb6.zip
Fixed various issues pointed out by cppcheck
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/test/test_libconfig.c')
-rw-r--r--src/test/test_libconfig.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/test/test_libconfig.c b/src/test/test_libconfig.c
index a3b233b98..e0a470e21 100644
--- a/src/test/test_libconfig.c
+++ b/src/test/test_libconfig.c
@@ -113,6 +113,7 @@ static const char *test_libconfig_read(void)
libconfig->destroy(&config);
return "Unable to read from file '" FILENAME "'.";
}
+ fclose(fp);
#undef FILENAME
if (config.root == NULL) {
libconfig->destroy(&config);
@@ -200,7 +201,6 @@ static const char *test_libconfig_set_include_dir(void)
static const char *test_libconfig_lookup(void)
{
struct config_t config;
- struct config_setting_t *t = NULL;
int32 i32;
int64 i64;
double f;
@@ -221,12 +221,12 @@ static const char *test_libconfig_lookup(void)
return "Unable to parse configuration.";
}
- if ((t = libconfig->lookup(&config, "Setting_Int")) == NULL) {
+ if (libconfig->lookup(&config, "Setting_Int") == NULL) {
libconfig->destroy(&config);
return "libconfig->lookup failed.";
}
- if ((t = libconfig->setting_lookup(config.root, "Setting_Int")) == NULL) {
+ if (libconfig->setting_lookup(config.root, "Setting_Int") == NULL) {
libconfig->destroy(&config);
return "libconfig->setting_lookup failed.";
}