From: Frédéric Marchal Date: Fri, 9 Mar 2012 13:40:02 +0000 (+0100) Subject: Avoid empty file name for the user's report file X-Git-Tag: v2.3.3-pre1~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=439d83cc8d1ca90ae5e9f4d0a18eb8f67c446412;p=thirdparty%2Fsarg.git 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. --- 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;