From 1a2261b89b700ae5d73bb82a7b581d7d30012f90 Mon Sep 17 00:00:00 2001 From: Eduardo Chappa Date: Wed, 13 May 2020 00:30:17 -0600 Subject: * Clear a few compilations warnings, produced by gcc. --- alpine/xoauth2conf.c | 10 +++++++--- imap/src/c-client/auth_oa2.c | 10 +++++----- imap/src/c-client/http.c | 12 ++++++------ imap/src/c-client/json.c | 2 +- pith/ical.c | 2 +- pith/pine.hlp | 2 +- 6 files changed, 21 insertions(+), 17 deletions(-) diff --git a/alpine/xoauth2conf.c b/alpine/xoauth2conf.c index 3509ef6..2e7ce49 100644 --- a/alpine/xoauth2conf.c +++ b/alpine/xoauth2conf.c @@ -162,7 +162,7 @@ xoauth_parse_client_info(char *lvalp, char **namep, char **idp, char **secretp) if (lvalp == NULL) return; - if(s = strstr(lvalp, XNAME)){ + if((s = strstr(lvalp, XNAME)) != NULL){ s += strlen(XNAME); if(*s == '"') s++; for(t = s; *t && *t != '"' && *t != ' '; t++); @@ -172,7 +172,7 @@ xoauth_parse_client_info(char *lvalp, char **namep, char **idp, char **secretp) *t = c; } - if(s = strstr(lvalp, XID)){ + if((s = strstr(lvalp, XID)) != NULL){ s += strlen(XID); if(*s == '"') s++; for(t = s; *t && *t != '"' && *t != ' '; t++); @@ -182,7 +182,7 @@ xoauth_parse_client_info(char *lvalp, char **namep, char **idp, char **secretp) *t = c; } - if(s = strstr(lvalp, XSECRET)){ + if((s = strstr(lvalp, XSECRET)) != NULL){ s += strlen(XSECRET); if(*s == '"') s++; for(t = s; *t && *t != '"' && *t != ' '; t++); @@ -219,6 +219,7 @@ alpine_xoauth2_configuration(struct pine *ps, int edit_exceptions) dprint((3, "-- alpine_xoauth2_configuration --\n")); + expose_hidden_config = F_ON(F_EXPOSE_HIDDEN_CONFIG, ps_global); ew = edit_exceptions ? ps_global->ew_for_except_vars : Main; if(ps->restricted) @@ -309,6 +310,9 @@ alpine_xoauth2_configuration(struct pine *ps, int edit_exceptions) ctmpa->help = NO_HELP; ctmpa->valoffset = 1; ctmpa->value = cpystr(alpine_oauth2_list[i].name); + ctmpa->varname = NULL; + ctmpa->varnamep = ctmpb = ctmpa; + /* Setup client-id variable */ varlist[l]->name = cpystr(XOAUTH2_CLIENT_ID); diff --git a/imap/src/c-client/auth_oa2.c b/imap/src/c-client/auth_oa2.c index 76a529e..a636bc4 100644 --- a/imap/src/c-client/auth_oa2.c +++ b/imap/src/c-client/auth_oa2.c @@ -44,19 +44,19 @@ char *oauth2_generate_state(void) rv[0] = '\0'; for(i = 0; i < 4; i++) - sprintf(rv + strlen(rv), "%x", random() % 256); + sprintf(rv + strlen(rv), "%x", (unsigned int) (random() % 256)); sprintf(rv + strlen(rv), "%c", '-'); for(i = 0; i < 2; i++) - sprintf(rv + strlen(rv), "%x", random() % 256); + sprintf(rv + strlen(rv), "%x", (unsigned int) (random() % 256)); sprintf(rv + strlen(rv), "%c", '-'); for(i = 0; i < 2; i++) - sprintf(rv + strlen(rv), "%x", random() % 256); + sprintf(rv + strlen(rv), "%x", (unsigned int) (random() % 256)); sprintf(rv + strlen(rv), "%c", '-'); for(i = 0; i < 2; i++) - sprintf(rv + strlen(rv), "%x", random() % 256); + sprintf(rv + strlen(rv), "%x", (unsigned int) (random() % 256)); sprintf(rv + strlen(rv), "%c", '-'); for(i = 0; i < 6; i++) - sprintf(rv + strlen(rv), "%x", random() % 256); + sprintf(rv + strlen(rv), "%x", (unsigned int) (random() % 256)); rv[36] = '\0'; return cpystr(rv); } diff --git a/imap/src/c-client/http.c b/imap/src/c-client/http.c index 7d95112..3f35195 100644 --- a/imap/src/c-client/http.c +++ b/imap/src/c-client/http.c @@ -919,11 +919,11 @@ http_post_param(char *url, HTTP_PARAM_S *param) HTTPSTREAM *stream; HTTP_PARAM_S enc_param; HTTP_REQUEST_S *http_request; - char *reply; + char *reply = NULL; int i; if(url == NULL || param == NULL || (stream = http_open(url)) == NULL) - return NULL; + return reply; http_request = http_request_get(); http_request->request = http_request_line("POST", stream->urltail, HTTP_1_1_VERSION); @@ -995,7 +995,7 @@ http_post_param2(char *url, HTTP_PARAM_S *param) char * http_get_param(char *base_url, HTTP_PARAM_S *param) { - char *url, *reply; + char *url, *reply = NIL; url = http_get_param_url(base_url, param); if(url){ @@ -1009,14 +1009,14 @@ char * http_get(char *url) { HTTP_REQUEST_S *http_request; - char *reply; + char *reply = NIL; HTTPSTREAM *stream; - if(!url) return NIL; + if(!url) return reply; stream = http_open(url); if(!stream){ fs_give((void **) &url); - return NIL; + return reply; } http_request = http_request_get(); diff --git a/imap/src/c-client/json.c b/imap/src/c-client/json.c index f6d0573..9a3e167 100644 --- a/imap/src/c-client/json.c +++ b/imap/src/c-client/json.c @@ -335,7 +335,7 @@ json_value_parse(unsigned char **s) JSON_S * json_array_parse(unsigned char **s) { - JSON_S *j; + JSON_S *j = NIL; unsigned char *w = *s; json_skipws(w); diff --git a/pith/ical.c b/pith/ical.c index e2f482f..332ed5d 100644 --- a/pith/ical.c +++ b/pith/ical.c @@ -1763,7 +1763,7 @@ ical_free_duration(ICAL_DURATION_S **ic_d) int ical_parse_duration(char *value, ICAL_DURATION_S *ic_d) { - int i, j, rv = 0; + int i, j = 0, rv = 0; if(value == NULL || ic_d == NULL) return -1; diff --git a/pith/pine.hlp b/pith/pine.hlp index 527a0e8..9af9db9 100644 --- a/pith/pine.hlp +++ b/pith/pine.hlp @@ -140,7 +140,7 @@ with help text for the config screen and the composer that didn't have any reasonable place to be called from. Dummy change to get revision in pine.hlp ============= h_revision ================= -Alpine Commit 425 2020-05-11 23:22:23 +Alpine Commit 426 2020-05-13 00:30:15 ============= h_news ================= -- cgit v1.2.3-54-g00ecf