From: Matthew Beeching Date: Tue, 4 Feb 2014 19:46:44 +0000 (+0000) Subject: Fixes for a few compiler warnings and errors X-Git-Url: https://jfr.im/git/irc/evilnet/x3.git/commitdiff_plain/b1763079f56bf5990d29ccafb1efeccce3c73656 Fixes for a few compiler warnings and errors --- diff --git a/src/math.c b/src/math.c index bf7ae8c..0cab1a6 100644 --- a/src/math.c +++ b/src/math.c @@ -24,7 +24,7 @@ #include "saxdb.h" #include "timeq.h" -#ifndef HAVE_MATH_H +#ifdef HAVE_MATH_H #include #include #else diff --git a/src/modcmd.c b/src/modcmd.c index 9276a54..1b55514 100644 --- a/src/modcmd.c +++ b/src/modcmd.c @@ -608,7 +608,9 @@ svccmd_expand_alias(struct svccmd *cmd, struct userNode *user, unsigned int old_ if (arg[1] == '$') { new_argv[new_argc++] = arg + 1; } else if (isdigit(arg[1])) { - unsigned int lbound, ubound, jj; + unsigned int lbound = 0; + unsigned int ubound = 0; + unsigned int jj = 0; char *end_num; lbound = strtoul(arg+1, &end_num, 10); diff --git a/src/x3ldap.c b/src/x3ldap.c index 1bc1158..e352d79 100644 --- a/src/x3ldap.c +++ b/src/x3ldap.c @@ -29,6 +29,8 @@ #include "config.h" #ifdef WITH_LDAP +#define LDAP_DEPRECATED 1 + #include #include #include @@ -276,7 +278,7 @@ char *make_password(const char *crypted) char *passbuf; packed = pack(crypted, &len); - base64_encode_alloc(packed, len, &base64pass); + base64_encode_alloc((char *)packed, len, &base64pass); passbuf = malloc(strlen(base64pass) + 1 + 5); strcpy(passbuf, "{MD5}"); strcat(passbuf, base64pass); @@ -360,7 +362,7 @@ int ldap_do_add(const char *account, const char *crypted, const char *email) LDAPMod **mods; int rc, i; int num_mods; - char *passbuf; + char *passbuf = NULL; if(!admin_bind && LDAP_SUCCESS != ( rc = ldap_do_admin_bind())) { log_module(MAIN_LOG, LOG_ERROR, "failed to bind as admin");