diff options
author | Mats <d912e3@gmail.com> | 2014-03-11 20:15:36 +0100 |
---|---|---|
committer | Michael Stapelberg <michael@stapelberg.de> | 2014-03-12 08:28:16 +0100 |
commit | 4f7da73885934a052425fc71861b0c9922c2122f (patch) | |
tree | f3872ee680309fa8955318f4d3a586cb08846a9d /src/print_ipv6_addr.c | |
parent | 52814295a0b3a0785631256e9e2dc6b8139e2be8 (diff) |
Unify use of string comparisons
* strncmp(s1, s2, strlen(s2)) → BEGINS_WITH(s1, s2)
* strncmp(s1, s2, strlen(s1)) → strcmp(s1, s2)
* Prefer case-insensitive comparison for options
Diffstat (limited to 'src/print_ipv6_addr.c')
-rw-r--r-- | src/print_ipv6_addr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/print_ipv6_addr.c b/src/print_ipv6_addr.c index fa50ea5..7ff9c97 100644 --- a/src/print_ipv6_addr.c +++ b/src/print_ipv6_addr.c @@ -136,7 +136,7 @@ void print_ipv6_info(yajl_gen json_gen, char *buffer, const char *format_up, con continue; } - if (strncmp(walk+1, "ip", strlen("ip")) == 0) { + if (BEGINS_WITH(walk+1, "ip")) { outwalk += sprintf(outwalk, "%s", addr_string); walk += strlen("ip"); } |