The sizeof operator doesn't always require the argument to be ()'d.
However it wasn't used consistently. Add ()s to all uses of sizeof.
{
crypt_key_t *k = NULL;
- k = safe_calloc (1, sizeof *k);
+ k = safe_calloc (1, sizeof (*k));
k->kobj = key->kobj;
gpgme_key_ref (key->kobj);
k->idx = key->idx;
&t->parameter);
/* Get the micalg from gpgme. Old gpgme versions don't support this
for S/MIME so we assume sha-1 in this case. */
- if (!get_micalg (ctx, use_smime, buf, sizeof buf))
+ if (!get_micalg (ctx, use_smime, buf, sizeof (buf)))
mutt_set_parameter ("micalg", buf, &t->parameter);
else if (use_smime)
mutt_set_parameter ("micalg", "sha1", &t->parameter);
but we know that this may only be text thus we assume Latin-1
here. */
if (!mutt_get_body_charset (body_charset, sizeof (body_charset), m))
- strfcpy (body_charset, "iso-8859-1", sizeof body_charset);
+ strfcpy (body_charset, "iso-8859-1", sizeof (body_charset));
fseeko (s->fpin, m->offset, 0);
last_pos = m->offset;
int i;
arraysize = 7; /* C,ST,L,O,OU,CN,email */
- array = safe_malloc ((arraysize+1) * sizeof *array);
+ array = safe_malloc ((arraysize+1) * sizeof (*array));
arrayidx = 0;
while (*string)
{
struct dn_array_s *a2 = NULL;
arraysize += 5;
- a2 = safe_malloc ((arraysize+1) * sizeof *array);
+ a2 = safe_malloc ((arraysize+1) * sizeof (*array));
for (i=0; i < arrayidx; i++)
{
a2[i].key = array[i].key;
tm = localtime (&tt);
#ifdef HAVE_LANGINFO_D_T_FMT
- strftime (shortbuf, sizeof shortbuf, nl_langinfo (D_T_FMT), tm);
+ strftime (shortbuf, sizeof (shortbuf), nl_langinfo (D_T_FMT), tm);
#else
- strftime (shortbuf, sizeof shortbuf, "%c", tm);
+ strftime (shortbuf, sizeof (shortbuf), "%c", tm);
#endif
/* L10N: DOTFILL */
fprintf (fp, _("Valid From : %s\n"), shortbuf);
tm = localtime (&tt);
#ifdef HAVE_LANGINFO_D_T_FMT
- strftime (shortbuf, sizeof shortbuf, nl_langinfo (D_T_FMT), tm);
+ strftime (shortbuf, sizeof (shortbuf), nl_langinfo (D_T_FMT), tm);
#else
- strftime (shortbuf, sizeof shortbuf, "%c", tm);
+ strftime (shortbuf, sizeof (shortbuf), "%c", tm);
#endif
/* L10N: DOTFILL */
fprintf (fp, _("Valid To ..: %s\n"), shortbuf);
tm = localtime (&tt);
#ifdef HAVE_LANGINFO_D_T_FMT
- strftime (shortbuf, sizeof shortbuf, nl_langinfo (D_T_FMT), tm);
+ strftime (shortbuf, sizeof (shortbuf), nl_langinfo (D_T_FMT), tm);
#else
- strftime (shortbuf, sizeof shortbuf, "%c", tm);
+ strftime (shortbuf, sizeof (shortbuf), "%c", tm);
#endif
/* L10N: DOTFILL */
fprintf (fp, _("Valid From : %s\n"), shortbuf);
tm = localtime (&tt);
#ifdef HAVE_LANGINFO_D_T_FMT
- strftime (shortbuf, sizeof shortbuf, nl_langinfo (D_T_FMT), tm);
+ strftime (shortbuf, sizeof (shortbuf), nl_langinfo (D_T_FMT), tm);
#else
- strftime (shortbuf, sizeof shortbuf, "%c", tm);
+ strftime (shortbuf, sizeof (shortbuf), "%c", tm);
#endif
/* L10N: DOTFILL */
fprintf (fp, _("Valid To ..: %s\n"), shortbuf);
if (!n)
goto no_pgphints;
- patarr = safe_calloc (n+1, sizeof *patarr);
+ patarr = safe_calloc (n+1, sizeof (*patarr));
for(l=hints, n=0; l; l = l->next)
{
if (l->data && *l->data)
for (idx = 0, uid = key->uids; uid; idx++, uid = uid->next)
{
- k = safe_calloc (1, sizeof *k);
+ k = safe_calloc (1, sizeof (*k));
k->kobj = key;
gpgme_key_ref (k->kobj);
k->idx = idx;
for (idx = 0, uid = key->uids; uid; idx++, uid = uid->next)
{
- k = safe_calloc (1, sizeof *k);
+ k = safe_calloc (1, sizeof (*k));
k->kobj = key;
gpgme_key_ref (k->kobj);
k->idx = idx;
Fqdn = safe_malloc (mutt_strlen (domain) + mutt_strlen (Hostname) + 2);
sprintf (Fqdn, "%s.%s", NONULL(Hostname), domain); /* __SPRINTF_CHECKED__ */
}
- else if (!(getdnsdomainname (buffer, sizeof buffer)))
+ else if (!(getdnsdomainname (buffer, sizeof (buffer))))
{
Fqdn = safe_malloc (mutt_strlen (buffer) + mutt_strlen (Hostname) + 2);
sprintf (Fqdn, "%s.%s", NONULL(Hostname), buffer); /* __SPRINTF_CHECKED__ */
{
do
{
- if (mutt_set_xdg_path (kXDGConfigDirs, buffer, sizeof buffer))
+ if (mutt_set_xdg_path (kXDGConfigDirs, buffer, sizeof (buffer)))
break;
- snprintf (buffer, sizeof buffer, "%s/neomuttrc-%s", SYSCONFDIR, PACKAGE_VERSION);
+ snprintf (buffer, sizeof (buffer), "%s/neomuttrc-%s", SYSCONFDIR, PACKAGE_VERSION);
if (access (buffer, F_OK) == 0)
break;
- snprintf (buffer, sizeof buffer, "%s/neomuttrc", SYSCONFDIR);
+ snprintf (buffer, sizeof (buffer), "%s/neomuttrc", SYSCONFDIR);
if (access (buffer, F_OK) == 0)
break;
- snprintf (buffer, sizeof buffer, "%s/Muttrc-%s", SYSCONFDIR, MUTT_VERSION);
+ snprintf (buffer, sizeof (buffer), "%s/Muttrc-%s", SYSCONFDIR, MUTT_VERSION);
if (access (buffer, F_OK) == 0)
break;
- snprintf (buffer, sizeof buffer, "%s/Muttrc", SYSCONFDIR);
+ snprintf (buffer, sizeof (buffer), "%s/Muttrc", SYSCONFDIR);
if (access (buffer, F_OK) == 0)
break;
- snprintf (buffer, sizeof buffer, "%s/neomuttrc-%s", PKGDATADIR, PACKAGE_VERSION);
+ snprintf (buffer, sizeof (buffer), "%s/neomuttrc-%s", PKGDATADIR, PACKAGE_VERSION);
if (access (buffer, F_OK) == 0)
break;
- snprintf (buffer, sizeof buffer, "%s/neomuttrc", PKGDATADIR);
+ snprintf (buffer, sizeof (buffer), "%s/neomuttrc", PKGDATADIR);
if (access (buffer, F_OK) == 0)
break;
- snprintf (buffer, sizeof buffer, "%s/Muttrc-%s", PKGDATADIR, MUTT_VERSION);
+ snprintf (buffer, sizeof (buffer), "%s/Muttrc-%s", PKGDATADIR, MUTT_VERSION);
if (access (buffer, F_OK) == 0)
break;
- snprintf (buffer, sizeof buffer, "%s/Muttrc", PKGDATADIR);
+ snprintf (buffer, sizeof (buffer), "%s/Muttrc", PKGDATADIR);
} while (0);
if (access (buffer, F_OK) == 0)
{
{
char abs_oldpath[_POSIX_PATH_MAX];
- if ((getcwd (abs_oldpath, sizeof abs_oldpath) == NULL) ||
- (strlen (abs_oldpath) + 1 + strlen (oldpath) + 1 > sizeof abs_oldpath))
+ if ((getcwd (abs_oldpath, sizeof (abs_oldpath)) == NULL) ||
+ (strlen (abs_oldpath) + 1 + strlen (oldpath) + 1 > sizeof (abs_oldpath)))
return -1;
strcat (abs_oldpath, "/"); /* __STRCAT_CHECKED__ */
* sure we seek to the correct location
*/
if (ctx->magic == MUTT_MMDF)
- offset -= (sizeof MMDF_SEP - 1);
+ offset -= (sizeof (MMDF_SEP) - 1);
/* allocate space for the new offsets */
newOffset = safe_calloc (ctx->msgcount - first, sizeof (struct m_update_t));
static inline void
set_uint32 (char *cp, md5_uint32 v)
{
- memcpy (cp, &v, sizeof v);
+ memcpy (cp, &v, sizeof (v));
}
/* Put result from CTX in first 16 bytes following RESBUF. The result
md5_read_ctx (const struct md5_ctx *ctx, void *resbuf)
{
char *r = resbuf;
- set_uint32 (r + 0 * sizeof ctx->A, SWAP (ctx->A));
- set_uint32 (r + 1 * sizeof ctx->B, SWAP (ctx->B));
- set_uint32 (r + 2 * sizeof ctx->C, SWAP (ctx->C));
- set_uint32 (r + 3 * sizeof ctx->D, SWAP (ctx->D));
+ set_uint32 (r + 0 * sizeof (ctx->A), SWAP (ctx->A));
+ set_uint32 (r + 1 * sizeof (ctx->B), SWAP (ctx->B));
+ set_uint32 (r + 2 * sizeof (ctx->C), SWAP (ctx->C));
+ set_uint32 (r + 3 * sizeof (ctx->D), SWAP (ctx->D));
return resbuf;
}
{
struct tz_t *tz = NULL;
- tz = bsearch (ptz, TimeZones, sizeof TimeZones/sizeof (struct tz_t),
+ tz = bsearch (ptz, TimeZones, sizeof (TimeZones)/sizeof (struct tz_t),
sizeof (struct tz_t),
(int (*)(const void *, const void *)) ascii_strcasecmp
/* This is safe to do: A pointer to a struct equals
static inline pgp_key_t pgp_new_keyinfo(void)
{
- return safe_calloc (1, sizeof *((pgp_key_t)0));
+ return safe_calloc (1, sizeof (*((pgp_key_t)0)));
}
#endif /* CRYPT_BACKEND_CLASSIC_PGP */
{
struct sigaction sa;
- memset (&sa, 0, sizeof sa);
+ memset (&sa, 0, sizeof (sa));
sa.sa_handler = sighandler;
#ifdef SA_RESTART
if (disposition == 0)