From 9b7fdfc84a516ede415cd1941e5ff1d6312e83ff Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Mon, 10 Oct 2011 01:01:58 +0200 Subject: Fixes for include. --- sysdep/unix/main.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sysdep/unix/main.c') 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; } -- cgit v1.2.3