summaryrefslogtreecommitdiff
path: root/source3/lib/bitmap.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-12-09 21:42:00 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:53:34 -0500
commite53d78062878940d43526c2ef0fff3030fb64983 (patch)
treecae57e25cb6ac3c991f7d5a5ed26e83ff90d94fd /source3/lib/bitmap.c
parent695188cc262c08807760670c2b6d8c70deda2cdc (diff)
downloadsamba-e53d78062878940d43526c2ef0fff3030fb64983.tar.gz
samba-e53d78062878940d43526c2ef0fff3030fb64983.tar.bz2
samba-e53d78062878940d43526c2ef0fff3030fb64983.zip
r4120: Never, ever, doubt valgrind :-). Fix order of evaluation bug that's been in the
bitmap code for ever. Remove silly extra space in paranoid malloc. Jeremy. (This used to be commit 0a7d17bc9b178628da371e627014412e9bef5d42)
Diffstat (limited to 'source3/lib/bitmap.c')
-rw-r--r--source3/lib/bitmap.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source3/lib/bitmap.c b/source3/lib/bitmap.c
index a6b52efe09..f2442d2add 100644
--- a/source3/lib/bitmap.c
+++ b/source3/lib/bitmap.c
@@ -41,7 +41,7 @@ struct bitmap *bitmap_allocate(int n)
return NULL;
}
- memset(bm->b, 0, sizeof(bm->b[0])*(n+31)/32);
+ memset(bm->b, 0, sizeof(uint32)*((n+31)/32));
return bm;
}
@@ -78,7 +78,7 @@ struct bitmap *bitmap_talloc(TALLOC_CTX *mem_ctx, int n)
return NULL;
}
- memset(bm->b, 0, sizeof(bm->b[0])*(n+31)/32);
+ memset(bm->b, 0, sizeof(uint32)*((n+31)/32));
return bm;
}
@@ -92,7 +92,7 @@ int bitmap_copy(struct bitmap * const dst, const struct bitmap * const src)
int count = MIN(dst->n, src->n);
SMB_ASSERT(dst->b != src->b);
- memcpy(dst->b, src->b, sizeof(dst->b[0])*(count+31)/32);
+ memcpy(dst->b, src->b, sizeof(uint32)*((count+31)/32));
return count;
}