From 2907af472d1f33b3c422cb9f601c121b242aa9c7 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Sat, 7 Nov 2009 09:46:20 -0800 Subject: [PATCH] Try to silence some warnings from "checker". --- log.c | 2 +- main.c | 2 +- options.c | 12 +++++++----- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/log.c b/log.c index 5b4773fb..c08dd580 100644 --- a/log.c +++ b/log.c @@ -804,7 +804,7 @@ int log_format_has(const char *format, char esc) return 0; for (p = format; (p = strchr(p, '%')) != NULL; ) { - for (p++; *p == '\''; p++) {} + for (p++; *p == '\''; p++) {} /*SHARED ITERATOR*/ if (*p == '-') p++; while (isDigit(p)) diff --git a/main.c b/main.c index 00da2db9..038214fd 100644 --- a/main.c +++ b/main.c @@ -404,7 +404,7 @@ static pid_t do_cmd(char *cmd, char *machine, char *user, char **remote_argv, in cmd = rsh_env; if (!cmd) cmd = RSYNC_RSH; - cmd = strdup(cmd); /* MEMORY LEAK */ + cmd = strdup(cmd); /*MEMORY LEAK*/ if (!cmd) goto oom; diff --git a/options.c b/options.c index 0377ef6f..546f63d8 100644 --- a/options.c +++ b/options.c @@ -1421,14 +1421,16 @@ int parse_arguments(int *argc_p, const char ***argv_p) arg = sanitize_path(NULL, arg, NULL, 0, SP_DEFAULT); if (daemon_filter_list.head) { int rej; - char *dir, *cp = strdup(arg); + char *cp = strdup(arg); if (!cp) out_of_memory("parse_arguments"); if (!*cp) - goto options_rejected; - dir = cp + (*cp == '/' ? module_dirlen : 0); - clean_fname(dir, CFN_COLLAPSE_DOT_DOT_DIRS); - rej = check_filter(&daemon_filter_list, FLOG, dir, 0) < 0; + rej = 1; + else { + char *dir = cp + (*cp == '/' ? module_dirlen : 0); + clean_fname(dir, CFN_COLLAPSE_DOT_DOT_DIRS); + rej = check_filter(&daemon_filter_list, FLOG, dir, 0) < 0; + } free(cp); if (rej) goto options_rejected; -- 2.34.1