diff options
Diffstat (limited to 'ini')
-rw-r--r-- | ini/ini_config_ut.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/ini/ini_config_ut.c b/ini/ini_config_ut.c index 53ad334..362a941 100644 --- a/ini/ini_config_ut.c +++ b/ini/ini_config_ut.c @@ -1554,8 +1554,19 @@ int main(int argc, char *argv[]) srcdir = getenv("srcdir"); if(srcdir) { + + errno = 0; rundir = malloc(strlen(srcdir) + sizeof(inidir)); + if (!rundir) { + error = errno; + printf("Failed to allocate memory to store path" + " to the test files %d.\n", error); + return -1; + } + sprintf(rundir, "%s%s", srcdir, inidir); + + errno = 0; if(chdir(rundir) != 0) { error = errno; free(rundir); |