diff options
Diffstat (limited to 'lib/loopdev.c')
-rw-r--r-- | lib/loopdev.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/loopdev.c b/lib/loopdev.c index f917f187c..fd3f9bae5 100644 --- a/lib/loopdev.c +++ b/lib/loopdev.c @@ -144,11 +144,12 @@ int loopcxt_has_device(struct loopdev_cxt *lc) int loopcxt_init(struct loopdev_cxt *lc, int flags) { struct stat st; + struct loopdev_cxt dummy = UL_LOOPDEVCXT_EMPTY; if (!lc) return -EINVAL; - memset(lc, 0, sizeof(*lc)); + memcpy(lc, &dummy, sizeof(dummy)); lc->flags = flags; loopcxt_set_device(lc, NULL); |