checkpolicy: use correct unsigned format specifiers

The two variables policydb_lineno and source_lineno are both of the type
unsigned long; use the appropriate format specifier.

Found by Cppcheck

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
This commit is contained in:
Christian Göttsche 2021-11-12 16:41:50 +01:00 committed by James Carter
parent 7e30a10ba9
commit cc671d6a5e
1 changed files with 4 additions and 4 deletions

View File

@ -308,11 +308,11 @@ GLBLUB { return(GLBLUB); }
int yyerror(const char *msg)
{
if (source_file[0])
fprintf(stderr, "%s:%ld:",
fprintf(stderr, "%s:%lu:",
source_file, source_lineno);
else
fprintf(stderr, "(unknown source)::");
fprintf(stderr, "ERROR '%s' at token '%s' on line %ld:\n%s\n%s\n",
fprintf(stderr, "ERROR '%s' at token '%s' on line %lu:\n%s\n%s\n",
msg,
yytext,
policydb_lineno,
@ -327,11 +327,11 @@ int yywarn(const char *msg)
return yyerror(msg);
if (source_file[0])
fprintf(stderr, "%s:%ld:",
fprintf(stderr, "%s:%lu:",
source_file, source_lineno);
else
fprintf(stderr, "(unknown source)::");
fprintf(stderr, "WARNING '%s' at token '%s' on line %ld:\n%s\n%s\n",
fprintf(stderr, "WARNING '%s' at token '%s' on line %lu:\n%s\n%s\n",
msg,
yytext,
policydb_lineno,