policycoreutils: use string literal as format strings

Use string literal as format string so that compilers can validate the
count and types of the inherent arguments.

    sestatus.c: In function ‘printf_tab’:
    sestatus.c:175:16: error: format not a string literal, argument types not checked [-Werror=format-nonliteral]
      175 |         printf(buf, outp);
          |                ^~~

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
This commit is contained in:
Christian Göttsche 2021-11-12 16:41:52 +01:00 committed by James Carter
parent c42dcf58de
commit fb68d036b8

View File

@ -170,9 +170,7 @@ void load_checks(char *pc[], int *npc, char *fc[], int *nfc)
void printf_tab(const char *outp)
{
char buf[20];
snprintf(buf, sizeof(buf), "%%-%us", COL);
printf(buf, outp);
printf("%-*s", COL, outp);
}