From cc671d6a5e1381d8f0d405029216324b4ae870fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Fri, 12 Nov 2021 16:41:50 +0100 Subject: [PATCH] checkpolicy: use correct unsigned format specifiers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- checkpolicy/policy_scan.l | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/checkpolicy/policy_scan.l b/checkpolicy/policy_scan.l index 129a8a2a..ef9f1899 100644 --- a/checkpolicy/policy_scan.l +++ b/checkpolicy/policy_scan.l @@ -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,