From e602ce548d51961b207315aa445de43dffdfb576 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Thu, 5 Jan 2012 19:02:04 +0100 Subject: [PATCH] Fix bad memset() reported by clang --- bacula/src/stored/bcopy.c | 2 +- bacula/src/stored/bls.c | 2 +- bacula/src/stored/read_record.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bacula/src/stored/bcopy.c b/bacula/src/stored/bcopy.c index 3a10ea02c1..72398c2180 100644 --- a/bacula/src/stored/bcopy.c +++ b/bacula/src/stored/bcopy.c @@ -326,7 +326,7 @@ static bool record_cb(DCR *in_dcr, DEV_RECORD *rec) static void get_session_record(DEVICE *dev, DEV_RECORD *rec, SESSION_LABEL *sessrec) { const char *rtype; - memset(sessrec, 0, sizeof(sessrec)); + memset(sessrec, 0, sizeof(SESSION_LABEL)); switch (rec->FileIndex) { case PRE_LABEL: rtype = _("Fresh Volume Label"); diff --git a/bacula/src/stored/bls.c b/bacula/src/stored/bls.c index a7c396e574..77fa78e9dc 100644 --- a/bacula/src/stored/bls.c +++ b/bacula/src/stored/bls.c @@ -418,7 +418,7 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec) static void get_session_record(DEVICE *dev, DEV_RECORD *rec, SESSION_LABEL *sessrec) { const char *rtype; - memset(sessrec, 0, sizeof(sessrec)); + memset(sessrec, 0, sizeof(SESSION_LABEL)); jcr->JobId = 0; switch (rec->FileIndex) { case PRE_LABEL: diff --git a/bacula/src/stored/read_record.c b/bacula/src/stored/read_record.c index 968a9805f9..d998ccb37a 100644 --- a/bacula/src/stored/read_record.c +++ b/bacula/src/stored/read_record.c @@ -408,7 +408,7 @@ static void handle_session_record(DEVICE *dev, DEV_RECORD *rec, SESSION_LABEL *s const char *rtype; char buf[100]; - memset(sessrec, 0, sizeof(sessrec)); + memset(sessrec, 0, sizeof(SESSION_LABEL)); switch (rec->FileIndex) { case PRE_LABEL: rtype = _("Fresh Volume Label"); -- 2.39.5