checkpolicy: follow declaration-after-statement

Follow the project style of no declaration after statement.

Found by the GCC warning -Wdeclaration-after-statement.

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
This commit is contained in:
Christian Göttsche 2021-07-06 19:54:26 +02:00 committed by Nicolas Iooss
parent babc3d5351
commit 79e7724930
No known key found for this signature in database
GPG key ID: C191415F340DAAA0
3 changed files with 7 additions and 4 deletions

View file

@ -288,14 +288,16 @@ int main(int argc, char **argv)
}
if (policy_type != POLICY_BASE && outfile) {
char *out_name;
char *separator;
char *mod_name = modpolicydb.name;
char *out_path = strdup(outfile);
if (out_path == NULL) {
fprintf(stderr, "%s: out of memory\n", argv[0]);
exit(1);
}
char *out_name = basename(out_path);
char *separator = strrchr(out_name, '.');
out_name = basename(out_path);
separator = strrchr(out_name, '.');
if (separator) {
*separator = '\0';
}

View file

@ -1904,9 +1904,10 @@ int avrule_read_ioctls(struct av_ioctl_range_list **rangehead)
{
char *id;
struct av_ioctl_range_list *rnew, *r = NULL;
*rangehead = NULL;
uint8_t omit = 0;
*rangehead = NULL;
/* read in all the ioctl commands */
while ((id = queue_remove(id_queue))) {
if (strcmp(id,"~") == 0) {

View file

@ -697,8 +697,8 @@ int display_avblock(int field, policydb_t * policy,
{
avrule_block_t *block = policydb.global;
while (block != NULL) {
fprintf(out_fp, "--- begin avrule block ---\n");
avrule_decl_t *decl = block->branch_list;
fprintf(out_fp, "--- begin avrule block ---\n");
while (decl != NULL) {
if (display_avdecl(decl, field, policy, out_fp)) {
return -1;