From 1d8c9550bf7fb7f216fb67bc4adc7614b1b9eaa5 Mon Sep 17 00:00:00 2001
From: Mooffie <mooffie@gmail.com>
Date: Tue, 27 Dec 2016 13:40:24 +0200
Subject: [PATCH] Ticket #3747: extfs: hp48: fix float truncation.
Some printf implementations can't process with %d anything other than integers.
---
src/vfs/extfs/helpers/hp48+.in | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/vfs/extfs/helpers/hp48+.in b/src/vfs/extfs/helpers/hp48+.in
index 25da24a..af0ed6d 100644
a
|
b
|
done |
40 | 40 | echo QUIT)| $KERMIT -B >/dev/null |
41 | 41 | } |
42 | 42 | |
| 43 | # Returns the 1'st field, which stands for the file name. |
43 | 44 | hp48_retdir() |
44 | 45 | { |
45 | 46 | echo "$1" |
46 | 47 | } |
47 | 48 | |
| 49 | # Returns the 2'nd field, which stands for the file size. |
| 50 | # |
| 51 | # It truncates it from float to integer. |
48 | 52 | hp48_retsize() |
49 | 53 | { |
50 | | printf "%d" "$2" 2>/dev/null |
| 54 | echo ${2%.*} |
51 | 55 | } |
52 | 56 | |
53 | 57 | # |