The following commit has been merged in the master branch: commit ebe3e81baf183ff43aa1717b9b6d037b581ece76 Author: Linus Lüssing linus.luessing@ascom.ch Date: Sun Nov 28 16:17:16 2010 +0100
batctl: Fix substitution of mac addresses with a following ')'
So far, mac addresses which had a following closing bracket and not a comma were ignored for the bat-hosts substitutions. This commit allows the substitution of such mac addresses, too.
Signed-off-by: Linus Lüssing linus.luessing@ascom.ch
diff --git a/functions.c b/functions.c index 9b1e22b..52cfe4b 100644 --- a/functions.c +++ b/functions.c @@ -177,9 +177,17 @@ read: *space_ptr = '\0'; extra_char = '\0';
- if ((strlen(buff_ptr) == ETH_STR_LEN + 1) && (buff_ptr[ETH_STR_LEN] == ',')) { - extra_char = ','; - buff_ptr[ETH_STR_LEN] = '\0'; + if (strlen(buff_ptr) == ETH_STR_LEN + 1) { + extra_char = buff_ptr[ETH_STR_LEN]; + switch (extra_char) { + case ',': + case ')': + buff_ptr[ETH_STR_LEN] = '\0'; + break; + default: + extra_char = '\0'; + break; + } }
if (strlen(buff_ptr) != ETH_STR_LEN)