summaryrefslogtreecommitdiff
path: root/sysdep
diff options
context:
space:
mode:
Diffstat (limited to 'sysdep')
-rw-r--r--sysdep/unix/main.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sysdep/unix/main.c b/sysdep/unix/main.c
index 72f7e852..d6176841 100644
--- a/sysdep/unix/main.c
+++ b/sysdep/unix/main.c
@@ -171,11 +171,14 @@ cf_open(char *filename)
if (*filename != '/') {
snprintf(full_name, sizeof(full_name), "%s/%s", dirname(config_name), filename);
+ full_name[sizeof(full_name)-1] = 0;
cur = full_name;
}
if ((ret = open(cur, O_RDONLY)) == -1)
cf_error("Unable to open included configuration file: %s", cur);
+
+ return ret;
}