config-files.c, rfcparse.c: avoid portability issues

sizeof() returns a ssize_t, which needs to be formatted with "%zu".
Unfortunately, the 'z' modifier is a non-standard GNU extension.
This commit is contained in:
Peter Simons 2013-02-09 19:03:52 +01:00
parent 5609a9b48b
commit 14f8ed1b45
2 changed files with 4 additions and 4 deletions

View File

@ -70,7 +70,7 @@ int InitPetidomo(const char* masterconfig)
MasterConfig = calloc(sizeof(struct PD_Config), 1);
if (MasterConfig == NULL)
{
syslog(LOG_ERR, "Failed to allocate %d byte of memory.", sizeof(struct PD_Config));
syslog(LOG_ERR, "Failed to allocate memory for the global PD_Config data structure.");
return -1;
}
@ -254,7 +254,7 @@ const struct List_Config* getListConfig(const char * listname)
ListConfig = calloc(sizeof(struct List_Config), 1);
if (ListConfig == NULL)
{
syslog(LOG_ERR, "Failed to allocate %d byte of memory.", sizeof(struct List_Config));
syslog(LOG_ERR, "Failed to allocate memory for List_Config data structure.");
exit(EXIT_FAILURE);
}
if (!strcasecmp(listtype, "open"))

View File

@ -211,7 +211,7 @@ ParseMail(struct Mail **result, char * incoming_mail, const char * fqdn)
MailStruct = calloc(sizeof(struct Mail), 1);
if (MailStruct == NULL) {
syslog(LOG_ERR, "Failed to allocate %d byte of memory.", sizeof(struct Mail));
syslog(LOG_ERR, "Failed to allocate memory for Mail data structure.");
return -1;
}
@ -220,7 +220,7 @@ ParseMail(struct Mail **result, char * incoming_mail, const char * fqdn)
MailStruct->Header = strdup(incoming_mail);
if (MailStruct->Header == NULL) {
syslog(LOG_ERR, "Failed to allocate %d byte of memory.", strlen(incoming_mail));
syslog(LOG_ERR, "Failed to allocate memory for the incoming mail.");
return -1;
}
for (MailStruct->Body = MailStruct->Header;