Skip to content

Commit a14f085

Browse files
authored
Merge pull request #3342 from Simon-Brandt/master
SC2183: Fix pluralization for zero arguments in printf format string
2 parents 75614a7 + 913d1aa commit a14f085

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ShellCheck/Checks/Commands.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ checkPrintfVar = CommandCheck (Exactly "printf") (f . arguments) where
691691
let formats = getPrintfFormats string
692692
let formatCount = length formats
693693
let argCount = length more
694-
let pluraliseIfMany word n = if n > 1 then word ++ "s" else word
694+
let pluraliseIfMany word n = if n == 1 then word else word ++ "s"
695695

696696
return $ if
697697
| argCount == 0 && formatCount == 0 ->

0 commit comments

Comments
 (0)