Skip to content

Commit

Permalink
DNP3: minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
victorjulien committed Oct 27, 2016
1 parent 7cf231c commit 5dc9c1b
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/detect-dnp3.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,14 +186,13 @@ static int DetectDNP3FuncParseFunctionCode(char *str, uint8_t *fc)
if (ByteExtractStringUint8(fc, 10, strlen(str), str) >= 0) {
return 1;
}
else {
/* Lookup by name. */
for (size_t i = 0;
i < sizeof(DNP3FunctionNameMap) / sizeof(DNP3Mapping); i++) {
if (strcasecmp(str, DNP3FunctionNameMap[i].name) == 0) {
*fc = DNP3FunctionNameMap[i].value;
return 1;
}

/* Lookup by name. */
for (size_t i = 0;
i < sizeof(DNP3FunctionNameMap) / sizeof(DNP3Mapping); i++) {
if (strcasecmp(str, DNP3FunctionNameMap[i].name) == 0) {
*fc = DNP3FunctionNameMap[i].value;
return 1;
}
}

Expand Down

0 comments on commit 5dc9c1b

Please sign in to comment.