From cdef9e92c7c101f6b81a06810ebe43cc82367175 Mon Sep 17 00:00:00 2001 From: Krzysztof Nazarewski Date: Tue, 17 Oct 2023 17:27:15 +0200 Subject: [PATCH] limit name length to 12 characters found at https://github.com/akatrevorjay/edid-generator/issues/21#issuecomment-1025054600 --- modeline2edid | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modeline2edid b/modeline2edid index 56c5e4b..65142fd 100755 --- a/modeline2edid +++ b/modeline2edid @@ -32,6 +32,7 @@ template-S() { local name="${1//\"}" [[ -z "$name" ]] && echo "Could not parse modeline: $@" >&2 && return 1 + [[ "${#name}" -gt 12 ]] && echo "Name cannot be longer than 12 characters: $name is ${#name} characters long" >&2 && return 1 local fn="${name}.S" local -F pixel_clock_mhz=$2 @@ -60,7 +61,7 @@ template-S() { case $ratio in compute) ratio=$(find-supported-ratio $hdisp $vdisp 'UNKNOWN') - printf 'Computed ratio: %s' $ratio + printf 'Computed ratio: %s\n' $ratio [[ $ratio != 'UNKNOWN' ]] || return 1 ;; esac