[v2,2/3] batctl: Fix skipped substitutions of mac addresses with a following ', '
Commit Message
When batctl does not find a matching name for a given mac address in the
bat-hosts file, then it unfortunately removes the following ',' instead
of leaving the string unmodified. batctl bisect is then not able to find
the mac address anymore. This commit fixes this issue.
Signed-off-by: Linus Lüssing <linus.luessing@ascom.ch>
---
functions.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
@@ -201,16 +201,16 @@ read:
/* keep table format */
printf("%17s", bat_host->name);
- if (extra_char != '\0')
- printf("%c", extra_char);
-
- printf(" ");
goto written;
print_plain_buff:
- printf("%s ", buff_ptr);
+ printf("%s", buff_ptr);
written:
+ if (extra_char != '\0')
+ printf("%c", extra_char);
+
+ printf(" ");
buff_ptr = space_ptr + 1;
}