summaryrefslogtreecommitdiff
path: root/main/http.c
diff options
context:
space:
mode:
authorKinsey Moore <kmoore@digium.com>2013-09-06 18:53:32 +0000
committerKinsey Moore <kmoore@digium.com>2013-09-06 18:53:32 +0000
commit53dbe10f5c46c7c6b7899f25af356b19ecd66416 (patch)
tree59de2a34b2e14eb2db108c5355524cf3dcc79360 /main/http.c
parent5a3c17f91f58387db6f5a96e423cb85533626e46 (diff)
Fix build warnings
When AST_DEVMODE is not defined, ast_asserts are not compiled into the binary. In some cases, this means variables are not referenced or are set but unused which causes warnings to show up. (closes issue ASTERISK-22446) Reported by: Jason Parker (qwell) ........ Merged revisions 398521 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@398522 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/http.c')
-rw-r--r--main/http.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/main/http.c b/main/http.c
index 5d764b4ce..e687d037c 100644
--- a/main/http.c
+++ b/main/http.c
@@ -914,7 +914,9 @@ struct ast_http_auth *ast_http_get_auth(struct ast_variable *headers)
char decoded[256] = {};
char *username;
char *password;
+#ifdef AST_DEVMODE
int cnt;
+#endif /* AST_DEVMODE */
if (strcasecmp("Authorization", v->name) != 0) {
continue;
@@ -939,7 +941,10 @@ struct ast_http_auth *ast_http_get_auth(struct ast_variable *headers)
/* This will truncate "userid:password" lines to
* sizeof(decoded). The array is long enough that this shouldn't
* be a problem */
- cnt = ast_base64decode((unsigned char*)decoded, base64,
+#ifdef AST_DEVMODE
+ cnt =
+#endif /* AST_DEVMODE */
+ ast_base64decode((unsigned char*)decoded, base64,
sizeof(decoded) - 1);
ast_assert(cnt < sizeof(decoded));