From: Eric Bollengier Date: Thu, 5 Jan 2012 18:02:04 +0000 (+0100) Subject: Fix bad memset() reported by clang X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0a13eabbdc86ec2c513423fc430232615c0c08d3;p=bacula%2Fbacula Fix bad memset() reported by clang --- 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");