Skip to content

Commit

Permalink
Miss casts and zeroing of integers
Browse files Browse the repository at this point in the history
  • Loading branch information
Olivier Gagnon authored and Marco van Wieringen committed Sep 6, 2014
1 parent ab27160 commit cb213ec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/dird/dir_plugins.c
Expand Up @@ -514,12 +514,12 @@ static bRC bareosGetValue(bpContext *ctx, brDirVariable var, void *value)
Dmsg1(dbglvl, "BAREOS: return bDirVarLastRate=%d\n", jcr->LastRate);
break;
case bDirVarJobBytes:
*((int *)value) = jcr->JobBytes;
Dmsg1(dbglvl, "BAREOS: return bDirVarJobBytes=%d\n", jcr->JobBytes);
*((uint64_t *)value) = jcr->JobBytes;
Dmsg1(dbglvl, "BAREOS: return bDirVarJobBytes=%u\n", jcr->JobBytes);
break;
case bDirVarReadBytes:
*((int *)value) = jcr->ReadBytes;
Dmsg1(dbglvl, "BAREOS: return bDirVarReadBytes=%d\n", jcr->ReadBytes);
*((uint64_t *)value) = jcr->ReadBytes;
Dmsg1(dbglvl, "BAREOS: return bDirVarReadBytes=%u\n", jcr->ReadBytes);
break;
default:
break;
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/dird/python-dir.c
Expand Up @@ -515,7 +515,7 @@ static PyObject *PyBareosGetValue(PyObject *self, PyObject *args)
case bDirVarPriority:
case bDirVarFDJobStatus:
case bDirVarSDJobStatus: {
int value;
int value = 0;

ctx = PyGetbpContext(pyCtx);
if (bfuncs->getBareosValue(ctx, (brDirVariable)var, &value) == bRC_OK) {
Expand All @@ -530,7 +530,7 @@ static PyObject *PyBareosGetValue(PyObject *self, PyObject *args)
case bDirVarLastRate:
case bDirVarJobBytes:
case bDirVarReadBytes: {
uint64_t value;
uint64_t value = 0;

ctx = PyGetbpContext(pyCtx);
if (bfuncs->getBareosValue(ctx, (brDirVariable)var, &value) == bRC_OK) {
Expand Down

0 comments on commit cb213ec

Please sign in to comment.