X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fxmalloc.c;h=1f354dd1a0360e3a32851737c7581eaf641cc84d;hp=39dc03c7229d79d7d321781ba78283fd1ea4f59e;hb=acd018074972f9c13ffecffb618f799d914bbe97;hpb=dc26ecc28046d9f3cb56f10b22636d04218ad545 diff --git a/src/xmalloc.c b/src/xmalloc.c index 39dc03c7..1f354dd1 100644 --- a/src/xmalloc.c +++ b/src/xmalloc.c @@ -16,7 +16,7 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #if HAVE_CONFIG_H -# include "../config.h" +# include "config.h" #endif #include @@ -155,6 +155,7 @@ int xvasprintf(char **strp, const char *fmt, va_list ap) { int result = vsnprintf(buf, sizeof buf, fmt, ap); if(result < 0) exit(xalloc_exit_failure); + buf[sizeof buf - 1] = 0; *strp = xstrdup(buf); #else int result = vasprintf(strp, fmt, ap);