detect/app-layer-protocol: fix compile warning

detect-app-layer-protocol.c:160:11: error: initializing 'char *' with an expression of type 'const char *' discards qualifiers
      [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
  160 |     char *sep = strchr(arg, ',');
      |           ^     ~~~~~~~~~~~~~~~~
1 error generated.
pull/15315/head
Victor Julien 2 months ago
parent a45a70babd
commit 3564f2f928

@ -157,7 +157,7 @@ static DetectAppLayerProtocolData *DetectAppLayerProtocolParse(const char *arg,
AppProto alproto = ALPROTO_UNKNOWN; AppProto alproto = ALPROTO_UNKNOWN;
char alproto_copy[MAX_ALPROTO_NAME]; char alproto_copy[MAX_ALPROTO_NAME];
char *sep = strchr(arg, ','); const char *sep = strchr(arg, ',');
char *alproto_name; char *alproto_name;
if (sep && sep - arg < MAX_ALPROTO_NAME) { if (sep && sep - arg < MAX_ALPROTO_NAME) {
strlcpy(alproto_copy, arg, sep - arg + 1); strlcpy(alproto_copy, arg, sep - arg + 1);

Loading…
Cancel
Save