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:
parent
5609a9b48b
commit
14f8ed1b45
@ -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"))
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user