From 14f8ed1b45e8ddffec9831162584cede47f4bdf1 Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Sat, 9 Feb 2013 19:03:52 +0100 Subject: [PATCH] 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. --- config-files.c | 4 ++-- rfcparse.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config-files.c b/config-files.c index df937c1..21eec8c 100644 --- a/config-files.c +++ b/config-files.c @@ -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")) diff --git a/rfcparse.c b/rfcparse.c index 27fb420..f80f87a 100644 --- a/rfcparse.c +++ b/rfcparse.c @@ -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;