a whole lot of size_t -> ssize_t.
[apps/madmutt.git] / main.c
diff --git a/main.c b/main.c
index e3a0b83..8451c72 100644 (file)
--- a/main.c
+++ b/main.c
@@ -15,7 +15,7 @@
 
 #define MAIN_C 1
 
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
 
@@ -69,11 +69,11 @@ extern int optind;
 #endif
 
 #ifdef USE_HCACHE
-#if HAVE_QDBM
+#if defined(HAVE_QDBM)
 #include <depot.h>
-#elif HAVE_GDBM
+#elif defined(HAVE_GDBM)
 #include <gdbm.h>
-#elif HAVE_DB4
+#elif defined(HAVE_DB4)
 #include <db.h>
 #endif
 #endif
@@ -236,11 +236,11 @@ static void show_version (void)
 #endif
 
 #ifdef USE_HCACHE
-#if HAVE_QDBM
+#if defined(HAVE_QDBM)
   printf ("  qdbm %s\n", dpversion);
-#elif HAVE_GDBM
+#elif defined(HAVE_GDBM)
   printf ("  gdbm %s\n", gdbm_version);
-#elif HAVE_DB4
+#elif defined(HAVE_DB4)
   printf ("  DB4 %d.%d.%d\n", DB_VERSION_MAJOR, DB_VERSION_MINOR,
           DB_VERSION_PATCH);
 #endif
@@ -407,7 +407,7 @@ static void show_version (void)
          "-HAVE_LANGINFO_YESEXPR  "
 #endif
          "\n  "
-#if HAVE_ICONV
+#ifdef HAVE_ICONV
          "+HAVE_ICONV  "
 #else
          "-HAVE_ICONV  "
@@ -417,17 +417,17 @@ static void show_version (void)
 #else
          "-ICONV_NONTRANS  "
 #endif
-#if HAVE_LIBIDN
+#ifdef HAVE_LIBIDN
          "+HAVE_LIBIDN  "
 #else
          "-HAVE_LIBIDN  "
 #endif
-#if HAVE_GETSID
+#ifdef HAVE_GETSID
          "+HAVE_GETSID  "
 #else
          "-HAVE_GETSID  "
 #endif
-#if HAVE_GETADDRINFO
+#ifdef HAVE_GETADDRINFO
          "+HAVE_GETADDRINFO  "
 #else
          "-HAVE_GETADDRINFO  "
@@ -481,10 +481,10 @@ static void start_curses (void)
   keypad (stdscr, TRUE);
   cbreak ();
   noecho ();
-#if HAVE_TYPEAHEAD
+#ifdef HAVE_TYPEAHEAD
   typeahead (-1);               /* simulate smooth scrolling */
 #endif
-#if HAVE_META
+#ifdef HAVE_META
   meta (stdscr, TRUE);
 #endif
 }
@@ -518,7 +518,7 @@ int main (int argc, char **argv)
   int dump_variables = -1;
 
   /* initialize random number for tmp file creation */ 
-  srand ((unsigned int) time (NULL));
+  srand48((unsigned int) time (NULL));
   
   /* sanity check against stupid administrators */
   
@@ -538,7 +538,7 @@ int main (int argc, char **argv)
 
   mutt_error = mutt_nocurses_error;
   mutt_message = mutt_nocurses_error;
-  SRAND (time (NULL));
+  srand48 (time (NULL));
   umask (077);
 
   p_clear(Options, countof(Options));
@@ -721,12 +721,12 @@ int main (int argc, char **argv)
     address_t *a;
 
     for (; alias_queries; alias_queries = alias_queries->next) {
-      if ((a = alias_lookup(alias_queries->data))) {
+      if ((a = address_list_dup(alias_lookup(alias_queries->data)))) {
         /* output in machine-readable form */
         mutt_addrlist_to_idna (a, NULL);
         mutt_write_address_list (a, stdout, 0, 0);
-      }
-      else {
+        address_list_wipe(&a);
+      else {
         rv = 1;
         printf ("%s\n", alias_queries->data);
       }