Skip to content

Commit a8ab8eb

Browse files
authored
Fixed printf error for non-UTF formats
Merge pull request #46 Use "en_US.UTF-8" format to prevent printf error: m4bify: line 438: printf: 30.117029: invalid number
2 parents ea129b5 + 40734a6 commit a8ab8eb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

m4bify.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ function process_file_as_chapter {
470470
convert "${file}" "${output_m4a}" "${bitrate}" "${rel_path}"
471471

472472
# Format the timestamp with hours potentially exceeding 24
473-
timestamp=$(printf "%02d:%02d:%06.3f\n" \
473+
timestamp=$(LC_NUMERIC="en_US.UTF-8" printf "%02d:%02d:%06.3f\n" \
474474
"$(echo "${current_time} / 3600" | bc)" \
475475
"$(echo "${current_time} % 3600 / 60" | bc)" \
476476
"$(echo "${current_time} % 60" | bc)")
@@ -527,7 +527,7 @@ function process_dirs_as_chapter {
527527
done
528528

529529
# Format the timestamp with hours potentially exceeding 24
530-
timestamp=$(printf "%02d:%02d:%06.3f\n" \
530+
timestamp=$(LC_NUMERIC="en_US.UTF-8" printf "%02d:%02d:%06.3f\n" \
531531
"$(echo "${current_time} / 3600" | bc)" \
532532
"$(echo "${current_time} % 3600 / 60" | bc)" \
533533
"$(echo "${current_time} % 60" | bc)")

0 commit comments

Comments
 (0)