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:
Enji Cooper 2016-04-23 08:10:04 +00:00
parent 96ad8686f6
commit 62bc9ed546
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=298507

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 == '+') {