Skip to content

Commit

Permalink
Dont mix declarations with code.
Browse files Browse the repository at this point in the history
Move asserts after declarations.
  • Loading branch information
danzatt committed Nov 15, 2023
1 parent 7d4628e commit 11ab2f0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/integrity/integrity.c
Original file line number Diff line number Diff line change
Expand Up @@ -344,16 +344,16 @@ static int _create_reduced_device(struct crypt_device *cd,
char path[PATH_MAX];
struct device *dev;

assert(cd);
assert(name);
assert(device_size_sectors);
assert(ret_device);

struct crypt_dm_active_device dmd = {
.size = device_size_sectors,
.flags = CRYPT_ACTIVATE_PRIVATE,
};

assert(cd);
assert(name);
assert(device_size_sectors);
assert(ret_device);

r = snprintf(path, sizeof(path), "%s/%s", dm_get_dir(), name);
if (r < 0 || (size_t)r >= sizeof(path))
return -EINVAL;
Expand Down

0 comments on commit 11ab2f0

Please sign in to comment.