summaryrefslogtreecommitdiff
path: root/src/bitmap.c
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2009-06-17 16:40:46 +0200
committerMichael Schroeder <mls@suse.de>2009-06-17 16:40:46 +0200
commit8c908fb220d569d5ac829c406c2f67658607460e (patch)
treef88d4649926a6691403a6334801efe1f09d3430e /src/bitmap.c
parentdcfb57c9ac4e2e1c26674546080f000230add12c (diff)
downloadlibsolv-8c908fb220d569d5ac829c406c2f67658607460e.tar.gz
libsolv-8c908fb220d569d5ac829c406c2f67658607460e.tar.bz2
libsolv-8c908fb220d569d5ac829c406c2f67658607460e.zip
- beautify
Diffstat (limited to 'src/bitmap.c')
-rw-r--r--src/bitmap.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/bitmap.c b/src/bitmap.c
index 064fc4a..0485945 100644
--- a/src/bitmap.c
+++ b/src/bitmap.c
@@ -21,7 +21,7 @@ void
map_init(Map *m, int n)
{
m->size = (n + 7) >> 3;
- m->map = n ? sat_calloc(m->size, 1) : 0;
+ m->map = m->size ? sat_calloc(m->size, 1) : 0;
}
/* destructor */
@@ -37,8 +37,13 @@ void
map_init_clone(Map *t, Map *s)
{
t->size = s->size;
- t->map = sat_malloc(s->size);
- memcpy(t->map, s->map, t->size);
+ if (s->size)
+ {
+ t->map = sat_malloc(s->size);
+ memcpy(t->map, s->map, s->size);
+ }
+ else
+ t->map = 0;
}
/* grow a map */