Skip to content

Commit

Permalink
libselinux/utils/getseuser.c: fix build with gcc 4.8
Browse files Browse the repository at this point in the history
Fix the following build failure with gcc 4.8 which is raised since
version 3.2 and
156dd0d

getseuser.c:53:2: error: 'for' loop initial declarations are only allowed in C99 mode
  for (int i = 0; i < n; i++)
  ^

Fixes:
 - http://autobuild.buildroot.org/results/37eb0952a763256fbf6ef3c668f6c95fbdf2dd35

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  • Loading branch information
ffontaine authored and fishilico committed Jul 3, 2021
1 parent 532a4cc commit 4859b73
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libselinux/utils/getseuser.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ int main(int argc, char **argv)
{
char *seuser = NULL, *level = NULL;
char **contextlist;
int rc, n;
int rc, n, i;

if (argc != 3) {
fprintf(stderr, "usage: %s linuxuser fromcon\n", argv[0]);
Expand Down Expand Up @@ -50,7 +50,7 @@ int main(int argc, char **argv)
if (n == 0)
printf("no valid context found\n");

for (int i = 0; i < n; i++)
for (i = 0; i < n; i++)
printf("Context %d\t%s\n", i, contextlist[i]);

freeconary(contextlist);
Expand Down

0 comments on commit 4859b73

Please sign in to comment.