pointless/bad strncmp
This commit is contained in:
parent
d349e9f92c
commit
b36d343083
@ -1,8 +1,9 @@
|
||||
# $OpenBSD: Makefile,v 1.17 2004/12/16 00:31:26 alek Exp $
|
||||
# $OpenBSD: Makefile,v 1.18 2005/11/14 17:40:29 pvalchev Exp $
|
||||
|
||||
COMMENT= "TCP dump file analysis tool"
|
||||
|
||||
DISTNAME= tcptrace-6.2.0
|
||||
PKGNAME= ${DISTNAME}p0
|
||||
CATEGORIES= net
|
||||
HOMEPAGE= http://masaka.cs.ohiou.edu/software/tcptrace/
|
||||
MASTER_SITES= ${HOMEPAGE}/download/
|
||||
|
@ -1,24 +0,0 @@
|
||||
--- ns.c.orig Wed Oct 16 22:07:32 2002
|
||||
+++ ns.c Wed Oct 16 22:09:05 2002
|
||||
@@ -148,8 +148,8 @@ pread_ns(
|
||||
|
||||
tcpb->th_sport = tcpb->th_dport = iteration;
|
||||
|
||||
- is_tcp = strcmp(type, "tcp") == 0;
|
||||
- is_ack = strcmp(type, "ack") == 0;
|
||||
+ is_tcp = strncmp(type, "tcp", sizeof(type)) == 0;
|
||||
+ is_ack = strncmp(type, "ack", sizeof(type)) == 0;
|
||||
|
||||
/* if it's not a TCP data segment or ACK, discard and try again */
|
||||
if (!is_tcp && !is_ack)
|
||||
@@ -313,8 +313,8 @@ int pread_ns_fulltcp(
|
||||
}
|
||||
|
||||
tcpb->th_sport = tcpb->th_dport = iteration;
|
||||
- is_tcp = strcmp(type, "tcp") == 0;
|
||||
- is_ack = strcmp(type, "ack") == 0;
|
||||
+ is_tcp = strncmp(type, "tcp", sizeof(type)) == 0;
|
||||
+ is_ack = strncmp(type, "ack", sizeof(type)) == 0;
|
||||
|
||||
/* if it's not a TCP data segment or ACK, discard and try again */
|
||||
if (!is_tcp && !is_ack)
|
Loading…
Reference in New Issue
Block a user