[sr-dev] git:master:f2959f42: core: remove compiler warnings [-Wstring-plus-int]
Victor Seva
linuxmaniac at torreviejawireless.org
Sat Mar 7 12:01:26 CET 2020
Module: kamailio
Branch: master
Commit: f2959f422bb8171241728f5148d4b21c9cc2c681
URL: https://github.com/kamailio/kamailio/commit/f2959f422bb8171241728f5148d4b21c9cc2c681
Author: Victor Seva <linuxmaniac at torreviejawireless.org>
Committer: Victor Seva <linuxmaniac at torreviejawireless.org>
Date: 2020-03-07T12:01:08+01:00
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.
---
Modified: src/core/parser/parse_fline.c
---
Diff: https://github.com/kamailio/kamailio/commit/f2959f422bb8171241728f5148d4b21c9cc2c681.diff
Patch: https://github.com/kamailio/kamailio/commit/f2959f422bb8171241728f5148d4b21c9cc2c681.patch
---
diff --git a/src/core/parser/parse_fline.c b/src/core/parser/parse_fline.c
index a5aefb7ee8..5016a31d59 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;
}
}
More information about the sr-dev
mailing list