summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2016-08-28 01:56:51 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2016-08-28 01:57:10 -0700
commit4be1ab61f4c1784f6870a5d53185bb0a6d9c5312 (patch)
tree80dd25e81b3874925eca7a3f72836bc9d4a4c662
parenta1a777ffdf13afebca24793ded469b3cf0e76290 (diff)
Pacify --enable-gcc-warnings for lib-src/pop.c
* lib-src/pop.c: Include c-ctype.h. (socket_connection): Pacify --enable-gcc-warnings by rewriting to avoid 'if (v = E) ...'. Use c_tolower, instead of a combination of the (undeclared) isupper and tolower. Fix pointer constness problem.
-rw-r--r--lib-src/pop.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/lib-src/pop.c b/lib-src/pop.c
index 74a6fc151a..99ec1cf824 100644
--- a/lib-src/pop.c
+++ b/lib-src/pop.c
@@ -90,6 +90,7 @@ extern struct servent *hes_getservbyname (/* char *, char * */);
# endif
#endif /* KERBEROS */
+#include <c-ctype.h>
#include <min-max.h>
#ifdef KERBEROS
@@ -718,7 +719,8 @@ pop_multi_next (popserver server, char **line)
return (-1);
}
- if ((ret = pop_getline (server, &fromserver)) < 0)
+ ret = pop_getline (server, &fromserver);
+ if (ret < 0)
{
return (-1);
}
@@ -1102,7 +1104,8 @@ socket_connection (char *host, int flags)
if (! (flags & POP_NO_KERBEROS))
{
#ifdef KERBEROS5
- if ((rem = krb5_init_context (&kcontext)))
+ rem = krb5_init_context (&kcontext);
+ if (rem)
{
krb5error:
if (auth_context)
@@ -1115,29 +1118,29 @@ socket_connection (char *host, int flags)
return (-1);
}
- if ((rem = krb5_auth_con_init (kcontext, &auth_context)))
+ rem = krb5_auth_con_init (kcontext, &auth_context);
+ if (rem)
goto krb5error;
- if (rem = krb5_cc_default (kcontext, &ccdef))
+ rem = krb5_cc_default (kcontext, &ccdef);
+ if (rem)
goto krb5error;
- if (rem = krb5_cc_get_principal (kcontext, ccdef, &client))
+ rem = krb5_cc_get_principal (kcontext, ccdef, &client);
+ if (rem)
goto krb5error;
for (cp = realhost; *cp; cp++)
- {
- if (isupper (*cp))
- {
- *cp = tolower (*cp);
- }
- }
+ *cp = c_tolower (*cp);
- if (rem = krb5_sname_to_principal (kcontext, realhost,
- POP_SERVICE, FALSE, &server))
+ rem = krb5_sname_to_principal (kcontext, realhost,
+ POP_SERVICE, FALSE, &server);
+ if (rem)
goto krb5error;
rem = krb5_sendauth (kcontext, &auth_context,
- (krb5_pointer) &sock, "KPOPV1.0", client, server,
+ (krb5_pointer) &sock, (char *) "KPOPV1.0",
+ client, server,
AP_OPTS_MUTUAL_REQUIRED,
0, /* no checksum */
0, /* no creds, use ccache instead */