summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2020-08-15 09:39:51 +0200
committerFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2020-08-15 09:43:03 +0200
commit2f7e6aff2af01a2ac0003dab0c19309da2bfc3dc (patch)
tree21e42597bcc7c9e3c124cb64beb3f8c66c1bc7f0
parent16e2bd5a8c2bd81a60d16030827c0e6f27910957 (diff)
downloadlibpcap-2f7e6aff2af01a2ac0003dab0c19309da2bfc3dc.tar.gz
usb-linux: Use sizeof() rather than a number
-rw-r--r--pcap-usb-linux.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pcap-usb-linux.c b/pcap-usb-linux.c
index 436a8452..9e7e8404 100644
--- a/pcap-usb-linux.c
+++ b/pcap-usb-linux.c
@@ -902,7 +902,7 @@ usb_read_linux(pcap_t *handle, int max_packets _U_, pcap_handler callback, u_cha
char string_truncated[181];
strncpy(string_truncated, string, sizeof(string_truncated));
- string_truncated[180] = 0;
+ string_truncated[sizeof(string_truncated) - 1] = 0;
snprintf(handle->errbuf, PCAP_ERRBUF_SIZE,
"Can't parse USB bus message '%s', too few tokens (expected 8 got %d)",
string_truncated, ret);