Fix looking for "UTC" at start of ptr by using strnmp instead of improperly

unrolled equivalent

CID: 1347118
MFC after: 1 week
Reported by: Coverity
Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
ngie 2016-04-23 08:10:04 +00:00
parent 0b911c8b6b
commit 3764d53f49

View File

@ -440,8 +440,8 @@ snmp_date2asn_oid(char *str, struct asn_oid *oid)
/* 'UTC' - optional */
ptr = endptr + 1;
if (*ptr == 'U' && *(ptr + 1) == 'T' && *(ptr + 1) == 'C')
ptr += 3;
if (strncmp(ptr, "UTC", strlen("UTC")) == 0)
ptr += strlen("UTC");
/* '+/-' */
if (*ptr == '-' || *ptr == '+') {