diff options
author | João Valverde <joao.valverde@tecnico.ulisboa.pt> | 2017-08-25 23:46:23 +0100 |
---|---|---|
committer | João Valverde <j@v6e.pt> | 2017-09-02 19:41:49 +0000 |
commit | b5a54c341612eff3ca455b6da8095f737d421e44 (patch) | |
tree | 4718fb81371b2f66b1b6e3ac17ce419de501005a /epan/addr_resolv.c | |
parent | be42b2bdeac66256c66cec8da5dab1204e0c0b8b (diff) |
manuf.tmpl: mark comments
Comments were discarded based on a fourth column using tab separators.
Use a pound sign instead.
Change-Id: Icb5dd33c4a2c9c441eebda74bc8d813443efe1b6
Reviewed-on: https://code.wireshark.org/review/23351
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
Diffstat (limited to 'epan/addr_resolv.c')
-rw-r--r-- | epan/addr_resolv.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/epan/addr_resolv.c b/epan/addr_resolv.c index 45014d1d09..1826321eec 100644 --- a/epan/addr_resolv.c +++ b/epan/addr_resolv.c @@ -1111,8 +1111,17 @@ parse_ether_line(char *line, ether_t *eth, unsigned int *mask, gchar *cp; - if ((cp = strchr(line, '#'))) + line = g_strstrip(line); + if (line[0] == '\0' || line[0] == '#') + return -1; + + if ((cp = strchr(line, '#'))) { + cp--; + while (g_ascii_isspace(*cp)) { + cp--; + } *cp = '\0'; + } if ((cp = strtok(line, " \t")) == NULL) return -1; @@ -1125,12 +1134,8 @@ parse_ether_line(char *line, ether_t *eth, unsigned int *mask, g_strlcpy(eth->name, cp, MAXNAMELEN); - if ((cp = strtok(NULL, "\t")) != NULL) + if ((cp = strtok(NULL, "")) != NULL) { - /* Remove access whitespace */ - while (g_ascii_isspace(*cp)) - cp++; - g_strlcpy(eth->longname, cp, MAXNAMELEN); } else { /* Make the long name the short name */ |