{
state->entrylen = 0;
state->entrymax = 256;
- state->entry = (struct folder_file *) safe_calloc (state->entrymax, sizeof (struct folder_file));
+ state->entry = safe_calloc (state->entrymax, sizeof (struct folder_file));
#ifdef USE_IMAP
state->imap_browse = 0;
#endif
char rp[PATH_MAX] = "";
char *r = NULL;
- buffy = (BUFFY *) safe_calloc (1, sizeof (BUFFY));
+ buffy = safe_calloc (1, sizeof (BUFFY));
strfcpy (buffy->path, path, sizeof (buffy->path));
r = realpath (path, rp);
strfcpy (buffy->realpath, r ? rp : path, sizeof (buffy->realpath));
menu->data = idx;
}
- idx[idxlen] = (ATTACHPTR *) safe_calloc (1, sizeof (ATTACHPTR));
+ idx[idxlen] = safe_calloc (1, sizeof (ATTACHPTR));
if ((idx[idxlen]->content = crypt_pgp_make_key_attachment(NULL)) != NULL)
{
update_idx (menu, idx, idxlen++);
for (i = 0; i < numfiles; i++)
{
char *att = files[i];
- idx[idxlen] = (ATTACHPTR *) safe_calloc (1, sizeof (ATTACHPTR));
+ idx[idxlen] = safe_calloc (1, sizeof (ATTACHPTR));
idx[idxlen]->unowned = 1;
idx[idxlen]->content = mutt_make_file_attach (att);
if (idx[idxlen]->content != NULL)
h = Context->hdrs[i];
if (h->tagged)
{
- idx[idxlen] = (ATTACHPTR *) safe_calloc (1, sizeof (ATTACHPTR));
+ idx[idxlen] = safe_calloc (1, sizeof (ATTACHPTR));
idx[idxlen]->content = mutt_make_message_attach (Context, h, 1);
if (idx[idxlen]->content != NULL)
update_idx (menu, idx, idxlen++);
menu->data = idx;
}
- idx[idxlen] = (ATTACHPTR *) safe_calloc (1, sizeof (ATTACHPTR));
/* Touch the file */
if (!(fp = safe_fopen (fname, "w")))
{
mutt_error (_("Can't create file %s"), fname);
- FREE (&idx[idxlen]);
continue;
}
safe_fclose (&fp);
+ idx[idxlen] = safe_calloc (1, sizeof (ATTACHPTR));
if ((idx[idxlen]->content = mutt_make_file_attach (fname)) == NULL)
{
mutt_error (_("What we have here is a failure to make an attachment"));
stte.WrapMargin = ((s->flags & MUTT_DISPLAY) ? (MuttIndexWindow->cols-4) :
((MuttIndexWindow->cols-4)<72)?(MuttIndexWindow->cols-4):72);
stte.line_max = stte.WrapMargin * 4;
- stte.line = (wchar_t *) safe_calloc (1, (stte.line_max + 1) * sizeof (wchar_t));
- stte.param = (wchar_t *) safe_calloc (1, (STRING) * sizeof (wchar_t));
+ stte.line = safe_calloc (1, (stte.line_max + 1) * sizeof (wchar_t));
+ stte.param = safe_calloc (1, (STRING) * sizeof (wchar_t));
stte.param_len = STRING;
stte.param_used = 0;
{
IMAP_DATA* idata = safe_calloc (1, sizeof (IMAP_DATA));
- if (!idata)
- return NULL;
-
if (!(idata->cmdbuf = mutt_buffer_new ()))
FREE (&idata);
if (!*list || last)
{
- t = (LIST *) safe_calloc (1, sizeof (LIST));
+ t = safe_calloc (1, sizeof (LIST));
t->data = safe_strdup (str);
if (last)
{
if (!tmp)
{
/* create a new alias */
- tmp = (ALIAS *) safe_calloc (1, sizeof (ALIAS));
+ tmp = safe_calloc (1, sizeof (ALIAS));
tmp->self = tmp;
tmp->name = safe_strdup (buf->data);
/* give the main addressbook code a chance */
MUTTMENU *mutt_new_menu (int menu)
{
- MUTTMENU *p = (MUTTMENU *) safe_calloc (1, sizeof (MUTTMENU));
+ MUTTMENU *p = safe_calloc (1, sizeof (MUTTMENU));
if ((menu < 0) || (menu >= MENU_MAX))
menu = MENU_GENERIC;
while (p && *p)
{
tag = safe_calloc(1, sizeof(struct uri_tag));
- if (!tag)
- goto err;
if (!*tags)
last = *tags = tag;
{
CONNECTION* conn;
- conn = (CONNECTION *) safe_calloc (1, sizeof (CONNECTION));
+ conn = safe_calloc (1, sizeof (CONNECTION));
conn->fd = -1;
return conn;
if (ssl_init())
goto bail;
- ssldata = (sslsockdata*) safe_calloc (1, sizeof (sslsockdata));
+ ssldata = safe_calloc (1, sizeof (sslsockdata));
/* the ssl_use_xxx protocol options don't apply. We must use TLS in TLS.
*
* However, we need to be able to negotiate amongst various TLS versions,
if (raw_socket_open (conn) < 0)
return -1;
- data = (sslsockdata *) safe_calloc (1, sizeof (sslsockdata));
+ data = safe_calloc (1, sizeof (sslsockdata));
conn->sockdata = data;
if (! (data->ctx = SSL_CTX_new (SSLv23_client_method ())))
FILE *fp;
menu->max = mutt_array_size (part) * 2 + 9;
- menu->dialog = (char **) safe_calloc (1, menu->max * sizeof (char *));
+ menu->dialog = safe_calloc (1, menu->max * sizeof (char *));
for (i = 0; i < menu->max; i++)
- menu->dialog[i] = (char *) safe_calloc (1, SHORT_STRING * sizeof (char));
+ menu->dialog[i] = safe_calloc (1, SHORT_STRING * sizeof (char));
row = 0;
strfcpy (menu->dialog[row], _("This certificate belongs to:"), SHORT_STRING);
tlssockdata *data;
int err;
- data = (tlssockdata *) safe_calloc (1, sizeof (tlssockdata));
+ data = safe_calloc (1, sizeof (tlssockdata));
conn->sockdata = data;
err = gnutls_certificate_allocate_credentials (&data->xcred);
if (err < 0)
return 0;
b64_data.size = filestat.st_size+1;
- b64_data_data = (unsigned char *) safe_calloc (1, b64_data.size);
+ b64_data_data = safe_calloc (1, b64_data.size);
b64_data_data[b64_data.size-1] = '\0';
b64_data.data = b64_data_data;
menu = mutt_new_menu (MENU_GENERIC);
menu->max = 25;
- menu->dialog = (char **) safe_calloc (1, menu->max * sizeof (char *));
+ menu->dialog = safe_calloc (1, menu->max * sizeof (char *));
for (i = 0; i < menu->max; i++)
- menu->dialog[i] = (char *) safe_calloc (1, SHORT_STRING * sizeof (char));
+ menu->dialog[i] = safe_calloc (1, SHORT_STRING * sizeof (char));
row = 0;
strfcpy (menu->dialog[row], _("This certificate belongs to:"), SHORT_STRING);
if (*QuoteList == NULL)
{
- class = (struct q_class_t *) safe_calloc (1, sizeof (struct q_class_t));
+ class = safe_calloc (1, sizeof (struct q_class_t));
class->color = ColorQuote[0];
*QuoteList = class;
}
if (tmp == NULL)
{
/* add a node above q_list */
- tmp = (struct q_class_t *) safe_calloc (1, sizeof (struct q_class_t));
- tmp->prefix = (char *) safe_calloc (1, length + 1);
+ tmp = safe_calloc (1, sizeof (struct q_class_t));
+ tmp->prefix = safe_calloc (1, length + 1);
strncpy (tmp->prefix, qptr, length);
tmp->length = length;
if (tmp == NULL)
{
/* add a node above q_list */
- tmp = (struct q_class_t *) safe_calloc (1,
- sizeof (struct q_class_t));
- tmp->prefix = (char *) safe_calloc (1, length + 1);
+ tmp = safe_calloc (1, sizeof (struct q_class_t));
+ tmp->prefix = safe_calloc (1, length + 1);
strncpy (tmp->prefix, qptr, length);
tmp->length = length;
/* still not found so far: add it as a sibling to the current node */
if (class == NULL)
{
- tmp = (struct q_class_t *) safe_calloc (1, sizeof (struct q_class_t));
- tmp->prefix = (char *) safe_calloc (1, length + 1);
+ tmp = safe_calloc (1, sizeof (struct q_class_t));
+ tmp->prefix = safe_calloc (1, length + 1);
strncpy (tmp->prefix, qptr, length);
tmp->length = length;
if (class == NULL)
{
/* not found so far: add it as a top level class */
- class = (struct q_class_t *) safe_calloc (1, sizeof (struct q_class_t));
- class->prefix = (char *) safe_calloc (1, length + 1);
+ class = safe_calloc (1, sizeof (struct q_class_t));
+ class->prefix = safe_calloc (1, length + 1);
strncpy (class->prefix, qptr, length);
class->length = length;
new_class_color (class, q_level);
snprintf (helpstr, sizeof (helpstr), "%s %s", tmphelp, buffer);
}
- index_status_window = safe_calloc (sizeof (mutt_window_t), 1);
- index_window = safe_calloc (sizeof (mutt_window_t), 1);
- pager_status_window = safe_calloc (sizeof (mutt_window_t), 1);
- pager_window = safe_calloc (sizeof (mutt_window_t), 1);
+ index_status_window = safe_calloc (1, sizeof (mutt_window_t));
+ index_window = safe_calloc (1, sizeof (mutt_window_t));
+ pager_status_window = safe_calloc (1, sizeof (mutt_window_t));
+ pager_window = safe_calloc (1, sizeof (mutt_window_t));
while (ch != -1)
{
{
if (first == NULL)
{
- first = (QUERY *) safe_calloc (1, sizeof (QUERY));
+ first = safe_calloc (1, sizeof (QUERY));
cur = first;
}
else
{
- cur->next = (QUERY *) safe_calloc (1, sizeof (QUERY));
+ cur->next = safe_calloc (1, sizeof (QUERY));
cur = cur->next;
}
for (queryp = results; queryp; queryp = queryp->next)
menu->max++;
- menu->data = QueryTable = (ENTRY *) safe_calloc (menu->max, sizeof (ENTRY));
+ menu->data = QueryTable = safe_calloc (menu->max, sizeof (ENTRY));
for (i = 0, queryp = results; queryp; queryp = queryp->next, i++)
QueryTable[i].data = queryp;
if (op == OP_QUERY)
{
- menu->data = QueryTable =
- (ENTRY *) safe_calloc (menu->max, sizeof (ENTRY));
+ menu->data = QueryTable = safe_calloc (menu->max, sizeof (ENTRY));
for (i = 0, queryp = results; queryp;
queryp = queryp->next, i++)
else
{
if (!idx[*idxlen])
- idx[*idxlen] = (ATTACHPTR *) safe_calloc (1, sizeof (ATTACHPTR));
+ idx[*idxlen] = safe_calloc (1, sizeof (ATTACHPTR));
new = idx[(*idxlen)++];
new->content = m;
rfc1524_entry *rfc1524_new_entry(void)
{
- return (rfc1524_entry *)safe_calloc(1, sizeof(rfc1524_entry));
+ return safe_calloc(1, sizeof(rfc1524_entry));
}
void rfc1524_free_entry(rfc1524_entry **entry)
if (!key)
return NULL;
- copy = safe_calloc (sizeof (smime_key_t), 1);
+ copy = safe_calloc (1, sizeof (smime_key_t));
copy->email = safe_strdup(key->email);
copy->hash = safe_strdup(key->hash);
copy->label = safe_strdup(key->label);
char *pend, *p;
int field = 0;
- key = safe_calloc (sizeof (smime_key_t), 1);
+ key = safe_calloc (1, sizeof (smime_key_t));
for (p = buf; p; p = pend)
{
if(copy && buffer && num)
{
(*num) = count;
- *buffer = safe_calloc(sizeof(char*), count);
+ *buffer = safe_calloc(count, sizeof(char*));
count = 0;
rewind (fpout);
len = mutt_strlen (email);
if (len && (email[len - 1] == '\n'))
email[len - 1] = '\0';
- (*buffer)[count] = safe_calloc(1, mutt_strlen (email) + 1);
+ (*buffer)[count] = safe_calloc(mutt_strlen (email) + 1, sizeof(char));
strncpy((*buffer)[count], email, mutt_strlen (email));
count++;
}