diff options
author | Michael Schroeder <mls@suse.de> | 2009-06-17 16:40:46 +0200 |
---|---|---|
committer | Michael Schroeder <mls@suse.de> | 2009-06-17 16:40:46 +0200 |
commit | 8c908fb220d569d5ac829c406c2f67658607460e (patch) | |
tree | f88d4649926a6691403a6334801efe1f09d3430e /src/bitmap.c | |
parent | dcfb57c9ac4e2e1c26674546080f000230add12c (diff) | |
download | libsolv-8c908fb220d569d5ac829c406c2f67658607460e.tar.gz libsolv-8c908fb220d569d5ac829c406c2f67658607460e.tar.bz2 libsolv-8c908fb220d569d5ac829c406c2f67658607460e.zip |
- beautify
Diffstat (limited to 'src/bitmap.c')
-rw-r--r-- | src/bitmap.c | 11 |
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 */ |