summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2014-02-02 15:02:33 -0800
committerGuy Harris <guy@alum.mit.edu>2014-02-02 15:02:33 -0800
commit89e2444c8b41776ad96c7a4c90a7bc030165c259 (patch)
treec22b311ce96b3096e48b02ba7a6f565644fa6a1c
parent6bfa3ea6aac54226bd694c45f08107755d45eda2 (diff)
downloadtcpdump-89e2444c8b41776ad96c7a4c90a7bc030165c259.tar.gz
Don't assume snprintf() returns the number of characters formatted.
On some UN*Xes (such as some versions of HP-UX), it doesn't.
-rw-r--r--print-icmp6.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/print-icmp6.c b/print-icmp6.c
index eaa48b03..ef5128c9 100644
--- a/print-icmp6.c
+++ b/print-icmp6.c
@@ -660,8 +660,8 @@ rpl_format_dagid(char dagid_str[65], const u_char *dagid)
if(isprint(dagid[i])) {
*d++ = dagid[i];
} else {
- int cnt=snprintf(d,4,"0x%02x", dagid[i]);
- d += cnt;
+ snprintf(d,4,"0x%02x", dagid[i]);
+ d += 4;
}
}
*d++ = '\0';