On Donnerstag, 15. September 2016 10:41:00 CEST Andreas Pape wrote:
The variable "optchar" used char instead of int leading to a non working batctl tp command as the while loop parsing the tp arguments with the getopt command is only left via the "default" case leaving the tp subcommand unusable. Using type char also lead to a compiler warning.
I find the commit message extreme confusing. It think you wanted to describe following problem:
* some platform C ABIs define char as unsigned * getopt can return negative values * the loop "around" getopt waits for a negative value to stop (which never happens with an unsigned char)
But the code change itself looks good.
Reviewed-by: Sven Eckelmann sven@narfation.org
Kind regards, Sven
tp_meter.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tp_meter.c b/tp_meter.c index 7fe0d56..10dc2b9 100644 --- a/tp_meter.c +++ b/tp_meter.c @@ -395,7 +395,7 @@ int tp_meter(char *mesh_iface, int argc, char **argv) int ret = EXIT_FAILURE; int found_args = 1, read_opt = USE_BAT_HOSTS; uint32_t time = 0;
- char optchar;
- int optchar; struct nl_sock *listen_sock = NULL; struct tp_result result = { .error = 0,