]> jfr.im git - irc/evilnet/x3.git/commitdiff
Fixes for a few compiler warnings and errors
authorMatthew Beeching <redacted>
Tue, 4 Feb 2014 19:46:44 +0000 (19:46 +0000)
committerMatthew Beeching <redacted>
Tue, 4 Feb 2014 19:46:44 +0000 (19:46 +0000)
src/math.c
src/modcmd.c
src/x3ldap.c

index bf7ae8c53e032151018377f2aff742014c590085..0cab1a673cf62afd0bb726f09bd0c60693d2cbcb 100644 (file)
@@ -24,7 +24,7 @@
 #include "saxdb.h"
 #include "timeq.h"
 
-#ifndef HAVE_MATH_H
+#ifdef HAVE_MATH_H
   #include <math.h>
   #include <complex.h>
 #else
index 9276a54c13cba9406894fa343642bba9ba6afa05..1b55514202951fdbb3826fa736e1f2fa4a215602 100644 (file)
@@ -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);
index 1bc115838d98d9fd72ea07fd0402c7cae7a8f843..e352d79e1bdd2b7db716aa054d54b70766aa7a14 100644 (file)
@@ -29,6 +29,8 @@
 #include "config.h"
 #ifdef WITH_LDAP
 
+#define LDAP_DEPRECATED 1
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <ldap.h>
@@ -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");