]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Don't write at root of filesystem if no output directory is provided
authorFrédéric Marchal <fmarchal@users.sourceforge.net>
Tue, 25 Jan 2011 21:07:40 +0000 (21:07 +0000)
committerFrédéric Marchal <fmarchal@users.sourceforge.net>
Tue, 25 Jan 2011 21:07:40 +0000 (21:07 +0000)
The empty output_dir is accepted but it produces an error as the
output directory must be absolute. That restriction might be aleviated
in the future.

log.c

diff --git a/log.c b/log.c
index 9b99a1ca3fddd083f27982cf0954d24e04d42b84..b3e2b6c5222fce2a9116f3d6566098a526bbc9de 100644 (file)
--- a/log.c
+++ b/log.c
@@ -607,7 +607,7 @@ int main(int argc,char *argv[])
        if(MaxElapsed[0] != '\0') max_elapsed=atol(MaxElapsed);
 
        if(outdir[0] == '\0') strcpy(outdir,OutputDir);
-       strcat(outdir,"/");
+       if(outdir[0] != '\0') strcat(outdir,"/");
 
        if(uagent[0] == '\0') strcpy(uagent,UserAgentLog);