From 3194ad6aa654dcb4a062a3953fa4f4b625e36f22 Mon Sep 17 00:00:00 2001 From: Dmitry Bogatov Date: Fri, 8 Nov 2013 13:04:06 +0400 Subject: [PATCH] [FIX] Absolute filenames Change-Id: Ib3fb05ea833e02fbd3a49f7c89f9b0b88b1e3d72 Fix: bc19c3728beae88801914b7ba975c53b31fce46e Signed-off-by: Dmitry Bogatov --- helper/dahelper.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/helper/dahelper.c b/helper/dahelper.c index 01f1708..fafe10a 100755 --- a/helper/dahelper.c +++ b/helper/dahelper.c @@ -129,9 +129,8 @@ char *absolutize_filepath(char buffer[PATH_MAX], const char *fname) assert(fname && "Filename, passed to stdc function is NULL."); if (absolute_filepath_p(fname) || getcwd(cwd, sizeof(cwd)) == NULL) - snprintf(buffer, sizeof(buffer), "%s", fname); + snprintf(buffer, PATH_MAX, "%s", fname); else - snprintf(buffer, sizeof(buffer), "%s/%s", cwd, fname); + snprintf(buffer, PATH_MAX, "%s/%s", cwd, fname); return buffer; } - -- 2.7.4