secilc/secil2tree: Test for stdout rather than stdin
PATCH 1/1 secilc/secil2tree: Test for stdout rather than stdin
When exiting there was a check "file != stdin" to avoid calling fclose on it, but that check should have been for stdout.
Check that file is not pointing to stdout before closing it.
Signed-off-by James Carter <[email protected]>
--- secilc/secil2tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
secilc/secil2tree.c +1 -1
@@ -220,7 +220,7 @@ int main(int argc, char *argv[]) } exit: -if (file !=NULL && file != stdin) { +if (file !=NULL && file != stdout) {fclose (file); }free (buffer);
Signature · 1 line
2.54.0
Quoted 7 lines · James Carter
When exiting there was a check "file != stdin" to avoid calling fclose on it, but that check should have been for stdout.
Check that file is not pointing to stdout before closing it.
Signed-off-by James Carter <[email protected]>
Acked-by Stephen Smalley <[email protected]>
Quoted 21 lines
--- secilc/secil2tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)secilc/secil2tree.c +1
-2@@ -220,7 +220,7 @@ int main(int argc, char *argv[]) } exit: -if (file !=NULL && file != stdin) { +if (file !=NULL && file != stdout) {fclose (file); }free (buffer); --2.54.0
Quoted 12 lines · Stephen Smalley
Quoted 7 lines · James Carter
When exiting there was a check "file != stdin" to avoid calling fclose on it, but that check should have been for stdout.
Check that file is not pointing to stdout before closing it.
Signed-off-by James Carter <[email protected]>Acked-by Stephen Smalley <[email protected]>
Merged.
Jim
Quoted 21 lines
Quoted 21 lines
--- secilc/secil2tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)secilc/secil2tree.c +1
-2@@ -220,7 +220,7 @@ int main(int argc, char *argv[]) } exit: -if (file !=NULL && file != stdin) { +if (file !=NULL && file != stdout) {fclose (file); }free (buffer); --2.54.0