Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix build errors when ENABLE_VERBOSE is not set
Fixes appneta#59

When ENABLE_VERBOSE is not set some additional calls to tcpreplay_seterr
are made. When conforming to C99 variadic macros at least one argument is
required after the format string[1]. To avoid this problem update the
calls to tcpreplay_seterr to use a "%s" format string.

[1] - http://gcc.gnu.org/onlinedocs/cpp/Variadic-Macros.html

Signed-off-by: Chris Packham <judge.packham@gmail.com>
  • Loading branch information
cpackham committed Jan 22, 2014
1 parent 3fd555a commit 12d0d08
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/tcpreplay_api.c
Expand Up @@ -690,7 +690,7 @@ tcpreplay_set_verbose(tcpreplay_t *ctx, bool value)
ctx->options->verbose = value;
return 0;
#else
tcpreplay_seterr(ctx, "verbose mode not supported");
tcpreplay_seterr(ctx, "%s", "verbose mode not supported");
return -1;
#endif
}
Expand All @@ -710,7 +710,7 @@ tcpreplay_set_tcpdump_args(tcpreplay_t *ctx, char *value)
ctx->options->tcpdump_args = safe_strdup(value);
return 0;
#else
tcpreplay_seterr(ctx, "verbose mode not supported");
tcpreplay_seterr(ctx, "%s", "verbose mode not supported");
return -1;
#endif
}
Expand All @@ -731,7 +731,7 @@ tcpreplay_set_tcpdump(tcpreplay_t *ctx, tcpdump_t *value)
ctx->options->tcpdump = value;
return 0;
#else
tcpreplay_seterr(ctx, "verbose mode not supported");
tcpreplay_seterr(ctx, "%s", "verbose mode not supported");
return -1;
#endif
}
Expand Down

0 comments on commit 12d0d08

Please sign in to comment.