summaryrefslogtreecommitdiff
path: root/res/res_xmpp.c
diff options
context:
space:
mode:
authorMichael Kuron <m.kuron@gmx.de>2017-08-20 15:15:37 +0200
committerMichael Kuron <m.kuron@gmx.de>2017-08-22 00:36:07 -0500
commit83b81d1f8d88a093bb3d4d7ae378bd0176996b73 (patch)
tree91fce751c6cd3ef759fa3ba3ec0fc077e077b8c3 /res/res_xmpp.c
parent12e63bdefc64486879dba952c5fcaa0866edef4c (diff)
res_xmpp: fix inverted return code check in OAuth
fetch_access_token calls func_curl via ast_func_read. The latter returns 0 upon success and -1 if the function is not available. This commit inverts the return code check so that an error is printed if the module is not loaded and not if it is loaded. ASTERISK-27207 #close Change-Id: I9ef903f80702d1218e8701f65a4e5e918e6548fb
Diffstat (limited to 'res/res_xmpp.c')
-rw-r--r--res/res_xmpp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/res/res_xmpp.c b/res/res_xmpp.c
index f8eb50599..444eacbe9 100644
--- a/res/res_xmpp.c
+++ b/res/res_xmpp.c
@@ -3915,7 +3915,7 @@ static int fetch_access_token(struct ast_xmpp_client_config *cfg)
ast_debug(2, "Performing OAuth 2.0 authentication for client '%s' using command: %s\n",
cfg->name, cmd);
- if (!ast_func_read(NULL, cmd, cBuf, sizeof(cBuf) - 1)) {
+ if (ast_func_read(NULL, cmd, cBuf, sizeof(cBuf) - 1)) {
ast_log(LOG_ERROR, "CURL is unavailable. This is required for OAuth 2.0 authentication of XMPP client '%s'. Please ensure it is loaded.\n",
cfg->name);
return -1;