From 439d83cc8d1ca90ae5e9f4d0a18eb8f67c446412 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20Marchal?= Date: Fri, 9 Mar 2012 14:40:02 +0100 Subject: [PATCH] Avoid empty file name for the user's report file If an empty user name creeps up to the name manufacturing function, the name generated to store the user's files is empty and it leads to the deletion of the whole report directory during the process. The visible results is that sarg ends up with an error because its output directory is missing. This patch makes sure no empty file name is used. It is still necessary to avoid empty user names in the first place. --- userinfo.c | 1 + 1 file changed, 1 insertion(+) diff --git a/userinfo.c b/userinfo.c index ec22838..9117a23 100644 --- a/userinfo.c +++ b/userinfo.c @@ -107,6 +107,7 @@ struct userinfostruct *userinfo_create(const char *userid) } } } + if (j==0) user->filename[j++]='_'; //don't leave a file name empty user->filename[j]='\0'; flen=i-1; -- 2.47.2