From f2959f422bb8171241728f5148d4b21c9cc2c681 Mon Sep 17 00:00:00 2001 From: Victor Seva Date: Sat, 7 Mar 2020 11:57:40 +0100 Subject: [PATCH] core: remove compiler warnings [-Wstring-plus-int] > core/parser/parse_fline.c:241:17: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int] > SIP_VERSION+1, SIP_VERSION_LEN-1)) { > ~~~~~~~~~~~^~ > > core/parser/parse_fline.c:241:17: note: use array indexing to silence this warning > SIP_VERSION+1, SIP_VERSION_LEN-1)) { > ^ > & [ ] > core/parser/parse_fline.c:247:18: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int] > HTTP_VERSION+1, HTTP_VERSION_LEN-1)) { > ~~~~~~~~~~~~^~ > > core/parser/parse_fline.c:247:18: note: use array indexing to silence this warning > HTTP_VERSION+1, HTTP_VERSION_LEN-1)) { > ^ > & [ ] > > 2 warnings generated. --- src/core/parser/parse_fline.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/parser/parse_fline.c b/src/core/parser/parse_fline.c index a5aefb7ee82..5016a31d590 100644 --- a/src/core/parser/parse_fline.c +++ b/src/core/parser/parse_fline.c @@ -238,13 +238,13 @@ char* parse_first_line(char* buffer, unsigned int len, struct msg_start* fl) && (fl->u.request.version.s[0]=='S' || fl->u.request.version.s[0]=='s') && !strncasecmp(fl->u.request.version.s+1, - SIP_VERSION+1, SIP_VERSION_LEN-1)) { + &SIP_VERSION[1], SIP_VERSION_LEN-1)) { fl->flags|=FLINE_FLAG_PROTO_SIP; } else if(fl->u.request.version.len >= HTTP_VERSION_LEN && (fl->u.request.version.s[0]=='H' || fl->u.request.version.s[0]=='h') && !strncasecmp(fl->u.request.version.s+1, - HTTP_VERSION+1, HTTP_VERSION_LEN-1)) { + &HTTP_VERSION[1], HTTP_VERSION_LEN-1)) { fl->flags|=FLINE_FLAG_PROTO_HTTP; } }