diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-05-15 23:24:48 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-05-17 18:13:14 +0200 |
commit | 2823e0192e9465f0260d5b43915fb925c5e6bdc8 (patch) | |
tree | 3b34341206c3027274b11f55a78bcfd46c5c0b60 /src/tools/config.c | |
parent | tools: check for proto error on set too (diff) | |
download | wireguard-monolithic-historical-2823e0192e9465f0260d5b43915fb925c5e6bdc8.tar.xz wireguard-monolithic-historical-2823e0192e9465f0260d5b43915fb925c5e6bdc8.zip |
tools: support text-based ipc
Diffstat (limited to 'src/tools/config.c')
-rw-r--r-- | src/tools/config.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/tools/config.c b/src/tools/config.c index 7007b88..f57fa82 100644 --- a/src/tools/config.c +++ b/src/tools/config.c @@ -15,7 +15,7 @@ #include "config.h" #include "ipc.h" -#include "base64.h" +#include "encoding.h" #define COMMENT_CHAR '#' @@ -171,14 +171,12 @@ static inline bool parse_endpoint(struct sockaddr *endpoint, const char *value) fprintf(stderr, "Unable to find matching brace of endpoint: `%s`\n", value); return false; } - *end = '\0'; - ++end; - if (*end != ':' || !*(end + 1)) { + *end++ = '\0'; + if (*end++ != ':' || !*end) { free(mutable); fprintf(stderr, "Unable to find port of endpoint: `%s`\n", value); return false; } - ++end; } else { begin = mutable; end = strrchr(mutable, ':'); @@ -187,8 +185,7 @@ static inline bool parse_endpoint(struct sockaddr *endpoint, const char *value) fprintf(stderr, "Unable to find port of endpoint: `%s`\n", value); return false; } - *end = '\0'; - ++end; + *end++ = '\0'; } for (unsigned int timeout = 1000000; timeout < 90000000; timeout = timeout * 3 / 2) { |