Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
95510d5b
Commit
95510d5b
authored
Apr 03, 2019
by
Piotr Caban
Committed by
Alexandre Julliard
Apr 03, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iphlpapi: Don't use strncasecmp.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
46a451f3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
17 deletions
+17
-17
ipstats.c
dlls/iphlpapi/ipstats.c
+17
-17
No files found.
dlls/iphlpapi/ipstats.c
View file @
95510d5b
...
...
@@ -302,7 +302,7 @@ DWORD getInterfaceStatsByName(const char *name, PMIB_IFROW entry)
while
((
ptr
=
fgets
(
buf
,
sizeof
(
buf
),
fp
)))
{
while
(
*
ptr
&&
isspace
(
*
ptr
))
ptr
++
;
if
(
strncase
cmp
(
ptr
,
name
,
nameLen
)
==
0
&&
*
(
ptr
+
nameLen
)
==
':'
)
if
(
_strni
cmp
(
ptr
,
name
,
nameLen
)
==
0
&&
*
(
ptr
+
nameLen
)
==
':'
)
{
ptr
+=
nameLen
+
1
;
sscanf
(
ptr
,
"%u %u %u %u %u %u %u %u %u %u %u %u"
,
...
...
@@ -433,10 +433,10 @@ DWORD WINAPI GetIcmpStatistics(PMIB_ICMP stats)
while
((
ptr
=
fgets
(
buf
,
sizeof
(
buf
),
fp
)))
{
if
(
strncase
cmp
(
buf
,
hdr
,
sizeof
(
hdr
)
-
1
))
continue
;
if
(
_strni
cmp
(
buf
,
hdr
,
sizeof
(
hdr
)
-
1
))
continue
;
/* last line was a header, get another */
if
(
!
(
ptr
=
fgets
(
buf
,
sizeof
(
buf
),
fp
)))
break
;
if
(
!
strncase
cmp
(
buf
,
hdr
,
sizeof
(
hdr
)
-
1
))
if
(
!
_strni
cmp
(
buf
,
hdr
,
sizeof
(
hdr
)
-
1
))
{
ptr
+=
sizeof
(
hdr
);
sscanf
(
ptr
,
"%u %u %u %u %u %u %u %u %u %u %u %u %u %u %u %u %u %u %u %u %u %u %u %u"
,
...
...
@@ -657,13 +657,13 @@ DWORD WINAPI GetIcmpStatisticsEx(PMIB_ICMP_EX stats, DWORD family)
if
((
ptr
=
strchr
(
value
,
'\n'
)))
*
ptr
=
'\0'
;
if
(
!
strcasecmp
(
buf
,
"Icmp6InMsgs"
))
if
(
!
_strnicmp
(
buf
,
"Icmp6InMsgs"
,
-
1
))
{
if
(
sscanf
(
value
,
"%d"
,
&
res
))
stats
->
icmpInStats
.
dwMsgs
=
res
;
continue
;
}
if
(
!
strcasecmp
(
buf
,
"Icmp6InErrors"
))
if
(
!
_strnicmp
(
buf
,
"Icmp6InErrors"
,
-
1
))
{
if
(
sscanf
(
value
,
"%d"
,
&
res
))
stats
->
icmpInStats
.
dwErrors
=
res
;
continue
;
...
...
@@ -671,7 +671,7 @@ DWORD WINAPI GetIcmpStatisticsEx(PMIB_ICMP_EX stats, DWORD family)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
icmpinstatlist
);
i
++
)
{
if
(
!
strcasecmp
(
buf
,
icmpinstatlist
[
i
].
name
))
if
(
!
_strnicmp
(
buf
,
icmpinstatlist
[
i
].
name
,
-
1
))
{
if
(
sscanf
(
value
,
"%d"
,
&
res
))
stats
->
icmpInStats
.
rgdwTypeCount
[
icmpinstatlist
[
i
].
pos
]
=
res
;
...
...
@@ -679,13 +679,13 @@ DWORD WINAPI GetIcmpStatisticsEx(PMIB_ICMP_EX stats, DWORD family)
}
}
if
(
!
strcasecmp
(
buf
,
"Icmp6OutMsgs"
))
if
(
!
_strnicmp
(
buf
,
"Icmp6OutMsgs"
,
-
1
))
{
if
(
sscanf
(
value
,
"%d"
,
&
res
))
stats
->
icmpOutStats
.
dwMsgs
=
res
;
continue
;
}
if
(
!
strcasecmp
(
buf
,
"Icmp6OutErrors"
))
if
(
!
_strnicmp
(
buf
,
"Icmp6OutErrors"
,
-
1
))
{
if
(
sscanf
(
value
,
"%d"
,
&
res
))
stats
->
icmpOutStats
.
dwErrors
=
res
;
continue
;
...
...
@@ -693,7 +693,7 @@ DWORD WINAPI GetIcmpStatisticsEx(PMIB_ICMP_EX stats, DWORD family)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
icmpoutstatlist
);
i
++
)
{
if
(
!
strcasecmp
(
buf
,
icmpoutstatlist
[
i
].
name
))
if
(
!
_strnicmp
(
buf
,
icmpoutstatlist
[
i
].
name
,
-
1
))
{
if
(
sscanf
(
value
,
"%d"
,
&
res
))
stats
->
icmpOutStats
.
rgdwTypeCount
[
icmpoutstatlist
[
i
].
pos
]
=
res
;
...
...
@@ -823,7 +823,7 @@ DWORD WINAPI GetIpStatisticsEx(PMIB_IPSTATS stats, DWORD family)
*
ptr
=
'\0'
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
ipstatlist
);
i
++
)
if
(
!
strcasecmp
(
buf
,
ipstatlist
[
i
].
name
)
&&
sscanf
(
value
,
"%d"
,
&
res
))
if
(
!
_strnicmp
(
buf
,
ipstatlist
[
i
].
name
,
-
1
)
&&
sscanf
(
value
,
"%d"
,
&
res
))
*
ipstatlist
[
i
].
elem
=
res
;
}
fclose
(
fp
);
...
...
@@ -847,10 +847,10 @@ DWORD WINAPI GetIpStatisticsEx(PMIB_IPSTATS stats, DWORD family)
while
((
ptr
=
fgets
(
buf
,
sizeof
(
buf
),
fp
)))
{
if
(
strncase
cmp
(
buf
,
hdr
,
sizeof
(
hdr
)
-
1
))
continue
;
if
(
_strni
cmp
(
buf
,
hdr
,
sizeof
(
hdr
)
-
1
))
continue
;
/* last line was a header, get another */
if
(
!
(
ptr
=
fgets
(
buf
,
sizeof
(
buf
),
fp
)))
break
;
if
(
!
strncase
cmp
(
buf
,
hdr
,
sizeof
(
hdr
)
-
1
))
if
(
!
_strni
cmp
(
buf
,
hdr
,
sizeof
(
hdr
)
-
1
))
{
ptr
+=
sizeof
(
hdr
);
sscanf
(
ptr
,
"%u %u %u %u %u %u %u %u %u %u %u %u %u %u %u %u %u %u %u"
,
...
...
@@ -1029,10 +1029,10 @@ DWORD WINAPI GetTcpStatisticsEx(PMIB_TCPSTATS stats, DWORD family)
while
((
ptr
=
fgets
(
buf
,
sizeof
(
buf
),
fp
)))
{
if
(
strncase
cmp
(
buf
,
hdr
,
sizeof
(
hdr
)
-
1
))
continue
;
if
(
_strni
cmp
(
buf
,
hdr
,
sizeof
(
hdr
)
-
1
))
continue
;
/* last line was a header, get another */
if
(
!
(
ptr
=
fgets
(
buf
,
sizeof
(
buf
),
fp
)))
break
;
if
(
!
strncase
cmp
(
buf
,
hdr
,
sizeof
(
hdr
)
-
1
))
if
(
!
_strni
cmp
(
buf
,
hdr
,
sizeof
(
hdr
)
-
1
))
{
ptr
+=
sizeof
(
hdr
);
sscanf
(
ptr
,
"%u %u %u %u %u %u %u %u %u %u %u %u %u %u"
,
...
...
@@ -1210,7 +1210,7 @@ DWORD WINAPI GetUdpStatisticsEx(PMIB_UDPSTATS stats, DWORD family)
*
ptr
=
'\0'
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
udpstatlist
);
i
++
)
if
(
!
strcasecmp
(
buf
,
udpstatlist
[
i
].
name
)
&&
sscanf
(
value
,
"%d"
,
&
res
))
if
(
!
_strnicmp
(
buf
,
udpstatlist
[
i
].
name
,
-
1
)
&&
sscanf
(
value
,
"%d"
,
&
res
))
*
udpstatlist
[
i
].
elem
=
res
;
}
fclose
(
fp
);
...
...
@@ -1234,10 +1234,10 @@ DWORD WINAPI GetUdpStatisticsEx(PMIB_UDPSTATS stats, DWORD family)
while
((
ptr
=
fgets
(
buf
,
sizeof
(
buf
),
fp
)))
{
if
(
strncase
cmp
(
buf
,
hdr
,
sizeof
(
hdr
)
-
1
))
continue
;
if
(
_strni
cmp
(
buf
,
hdr
,
sizeof
(
hdr
)
-
1
))
continue
;
/* last line was a header, get another */
if
(
!
(
ptr
=
fgets
(
buf
,
sizeof
(
buf
),
fp
)))
break
;
if
(
!
strncase
cmp
(
buf
,
hdr
,
sizeof
(
hdr
)
-
1
))
if
(
!
_strni
cmp
(
buf
,
hdr
,
sizeof
(
hdr
)
-
1
))
{
ptr
+=
sizeof
(
hdr
);
sscanf
(
ptr
,
"%u %u %u %u %u"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment