From: Andre Noll Date: Sat, 6 Jul 2013 19:31:11 +0000 (+0200) Subject: command.c: Remove pointless initialization. X-Git-Tag: v0.5.1~12^2~4 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=1d79373523915b77cdf3f845ac415feab4949fca;hp=c17ede547f11afdecc1a98bab6a88116ccb21c91 command.c: Remove pointless initialization. Found by the clang analyzer: command.c:934:16: warning: Assigned value is always the same as the existing value for (i = 0, p = iov->iov_base; p < end; i++) ~ ^ ~~~~~~~~~~~~~ clang is right: A couple of lines before the for loop we set p to iov->iov_base and do not modify it. --- diff --git a/command.c b/command.c index 4bbf494c..33cc4b2f 100644 --- a/command.c +++ b/command.c @@ -842,7 +842,7 @@ static int parse_sb_command(struct command_context *cc, struct iovec *iov) if (ret < 0) goto out; end = iov->iov_base + iov->iov_len; - for (i = 0, p = iov->iov_base; p < end; i++) + for (i = 0; p < end; i++) p += strlen(p) + 1; cc->argc = i; cc->argv = para_malloc((cc->argc + 1) * sizeof(char *));