Ticket #3747: 3747-extfs-hp48-fix-float-truncation.patch

File 3747-extfs-hp48-fix-float-truncation.patch, 911 bytes (added by mooffie, 7 years ago)
  • src/vfs/extfs/helpers/hp48+.in

    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 
    4040echo QUIT)| $KERMIT -B >/dev/null 
    4141} 
    4242 
     43# Returns the 1'st field, which stands for the file name. 
    4344hp48_retdir() 
    4445{ 
    4546echo "$1" 
    4647} 
    4748 
     49# Returns the 2'nd field, which stands for the file size. 
     50# 
     51# It truncates it from float to integer. 
    4852hp48_retsize() 
    4953{ 
    50 printf "%d" "$2" 2>/dev/null 
     54echo ${2%.*} 
    5155} 
    5256 
    5357#