]> granicus.if.org Git - neomutt/commitdiff
fix safe_calloc args
authorRichard Russon <rich@flatcap.org>
Tue, 30 May 2017 17:24:11 +0000 (18:24 +0100)
committerRichard Russon <rich@flatcap.org>
Thu, 1 Jun 2017 19:33:31 +0000 (20:33 +0100)
curs_lib.c
mh.c
muttlib.c
ncrypt/gnupgparse.c
pgppubring.c
remailer.c
rfc2231.c

index 545af1cc66a192546b7ac3bca3a7e84fae40c18d..6675f6d8e37ab0b0978358cfb1d9f4e04aa03cfc 100644 (file)
@@ -601,12 +601,12 @@ out:
 
 void mutt_init_windows(void)
 {
-  MuttHelpWindow = safe_calloc(sizeof(struct MuttWindow), 1);
-  MuttIndexWindow = safe_calloc(sizeof(struct MuttWindow), 1);
-  MuttStatusWindow = safe_calloc(sizeof(struct MuttWindow), 1);
-  MuttMessageWindow = safe_calloc(sizeof(struct MuttWindow), 1);
+  MuttHelpWindow = safe_calloc(1, sizeof(struct MuttWindow));
+  MuttIndexWindow = safe_calloc(1, sizeof(struct MuttWindow));
+  MuttStatusWindow = safe_calloc(1, sizeof(struct MuttWindow));
+  MuttMessageWindow = safe_calloc(1, sizeof(struct MuttWindow));
 #ifdef USE_SIDEBAR
-  MuttSidebarWindow = safe_calloc(sizeof(struct MuttWindow), 1);
+  MuttSidebarWindow = safe_calloc(1, sizeof(struct MuttWindow));
 #endif
 }
 
diff --git a/mh.c b/mh.c
index 885413b40ceb23a61173a49506ba566d890aef4f..9759debbe643a2336cafc680bf58ee654c52e5d3 100644 (file)
--- a/mh.c
+++ b/mh.c
@@ -843,7 +843,7 @@ static int maildir_parse_dir(struct Context *ctx, struct Maildir ***last,
     else
       h->path = safe_strdup(de->d_name);
 
-    entry = safe_calloc(sizeof(struct Maildir), 1);
+    entry = safe_calloc(1, sizeof(struct Maildir));
     entry->h = h;
     entry->inode = de->d_ino;
     **last = entry;
@@ -1238,7 +1238,7 @@ static int mh_read_dir(struct Context *ctx, const char *subdir)
 
   if (!ctx->data)
   {
-    ctx->data = safe_calloc(sizeof(struct MhData), 1);
+    ctx->data = safe_calloc(1, sizeof(struct MhData));
   }
   data = mh_data(ctx);
 
index bed0d556d1a8c2f22c152b813cf727efb7a0b6b2..d177fe329289457f7b0c5ba9129c064037044068 100644 (file)
--- a/muttlib.c
+++ b/muttlib.c
@@ -2029,9 +2029,9 @@ const char *mutt_make_version(void)
 
 struct Regex *mutt_compile_regexp(const char *s, int flags)
 {
-  struct Regex *pp = safe_calloc(sizeof(struct Regex), 1);
+  struct Regex *pp = safe_calloc(1, sizeof(struct Regex));
   pp->pattern = safe_strdup(s);
-  pp->rx = safe_calloc(sizeof(regex_t), 1);
+  pp->rx = safe_calloc(1, sizeof(regex_t));
   if (REGCOMP(pp->rx, NONULL(s), flags) != 0)
     mutt_free_regexp(&pp);
 
index aea1423bb14b1b97bb976b884b92b08bcb6d6130..34f61d10e1bd858ec4d2064b7fa2552f90b19d8d 100644 (file)
@@ -304,7 +304,7 @@ static struct PgpKeyInfo *parse_pub_line(char *buf, int *is_subkey, struct PgpKe
 
         mutt_debug(2, "user ID: %s\n", NONULL(p));
 
-        uid = safe_calloc(sizeof(struct PgpUid), 1);
+        uid = safe_calloc(1, sizeof(struct PgpUid));
         fix_uid(p);
         uid->addr = safe_strdup(p);
         uid->trust = trust;
index 750568db2dfd2f87e1d5ffae50170c4672afe087..f873151eb5418ba9cfbf6c355803ad03fa63eb0e 100644 (file)
@@ -685,7 +685,7 @@ static struct PgpKeyInfo *pgp_parse_keyblock(FILE *fp)
       {
         if (lsig)
         {
-          struct PgpSignature *signature = safe_calloc(sizeof(struct PgpSignature), 1);
+          struct PgpSignature *signature = safe_calloc(1, sizeof(struct PgpSignature));
           *lsig = signature;
           lsig = &signature->next;
 
index 57590b71cd38c479349249ccc7cef97d499e3d67..6c67af6290021d3f41bcc88dbc57972430e1691e 100644 (file)
@@ -474,7 +474,7 @@ void mix_make_chain(struct List **chainp)
     return;
   }
 
-  chain = safe_calloc(sizeof(struct MixChain), 1);
+  chain = safe_calloc(1, sizeof(struct MixChain));
   for (p = *chainp; p; p = p->next)
     mix_chain_add(chain, (char *) p->data, type2_list);
 
index 99c1071366554453dc73e8f8cd45fe9556ac2c0a..cd1ad00f83b72cf030cd863d35c6e772471470a7 100644 (file)
--- a/rfc2231.c
+++ b/rfc2231.c
@@ -109,7 +109,7 @@ static void rfc2231_decode_one(char *dest, char *src)
 
 static struct Rfc2231Parameter *rfc2231_new_parameter(void)
 {
-  return safe_calloc(sizeof(struct Rfc2231Parameter), 1);
+  return safe_calloc(1, sizeof(struct Rfc2231Parameter));
 }
 
 /* insert parameter into an ordered list.