diff mbox series

[libgpiod,v2,5/8] tools: tests: don't use variables in printf format string

Message ID 20240603115628.102616-6-warthog618@gmail.com
State New
Headers show
Series tools: tests: fix shellcheck warnings | expand

Commit Message

Kent Gibson June 3, 2024, 11:56 a.m. UTC
Fix shellcheck SC2059[1] - don't use variables in the printf format
string.

[1] https://www.shellcheck.net/wiki/SC2059

Signed-off-by: Kent Gibson <warthog618@gmail.com>
---
 tools/gpio-tools-test.bash | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/tools/gpio-tools-test.bash b/tools/gpio-tools-test.bash
index efe558b..d9930f1 100755
--- a/tools/gpio-tools-test.bash
+++ b/tools/gpio-tools-test.bash
@@ -3048,7 +3048,7 @@  die() {
 oneTimeSetUp() {
 	test "$SHUNIT_VERSION" = "$MIN_SHUNIT_VERSION" && return 0
 	local FIRST
-	FIRST=$(printf "$SHUNIT_VERSION\n$MIN_SHUNIT_VERSION\n" | sort -Vr | head -1)
+	FIRST=$(printf "%s\n%s\n" "$SHUNIT_VERSION" "$MIN_SHUNIT_VERSION" | sort -Vr | head -1)
 	test "$FIRST" = "$MIN_SHUNIT_VERSION" && \
 		die "minimum shunit version required is $MIN_SHUNIT_VERSION (current version is $SHUNIT_VERSION"
 }
@@ -3058,7 +3058,7 @@  check_kernel() {
 	local CURRENT
 	CURRENT=$(uname -r)
 
-	SORTED=$(printf "$REQUIRED\n$CURRENT" | sort -V | head -n 1)
+	SORTED=$(printf "%s\n%s" "$REQUIRED" "$CURRENT" | sort -V | head -n 1)
 
 	if [ "$SORTED" != "$REQUIRED" ]
 	then