After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 768239 - sizes are wrong with musl libc due to use of non-standard sscanf "%Ld" modifier
sizes are wrong with musl libc due to use of non-standard sscanf "%Ld" modifier
Status: RESOLVED FIXED
Product: gparted
Classification: Other
Component: application
0.26.1
Other Linux
: Normal normal
: ---
Assigned To: gparted maintainers alias
gparted maintainers alias
Depends on:
Blocks:
 
 
Reported: 2016-06-30 10:55 UTC by ncopa
Modified: 2016-10-19 16:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
0001-Fix-sscanf-modifier-for-long-long.patch (10.77 KB, patch)
2016-06-30 11:01 UTC, ncopa
none Details | Review

Description ncopa 2016-06-30 10:55:41 UTC
On Alpine Linux (with musl libc) the used size of ntfs partition is calculated wrong due to sscanf is using %Ld as modifier. POSIX says that %lld should be used for long long.

http://pubs.opengroup.org/onlinepubs/9699919799/functions/fscanf.html
Comment 1 ncopa 2016-06-30 11:01:03 UTC
Created attachment 330644 [details] [review]
0001-Fix-sscanf-modifier-for-long-long.patch

Proposed fix
Comment 2 Mike Fleetwood 2016-07-01 14:39:17 UTC
Hi Natanael,

Thank you for the patch.  I have also added changing the use of scanf
directive "%Lx" to "%llx" in jfs.cc too.

Successfully tested on CentOS 5 and Ubuntu 16.04 LTS.  Read a range of
file system usages: ext*, fat*, jfs, linux_swap, ntfs, xfs; read ntfs
>= 5 GIB in size; progress of ext* create and copy using e2image.

The following commit has been committed to upstream GIT and will be
included in the next release of GParted.

Fix sscanf modifier for long long (#768239)
https://git.gnome.org/browse/gparted/commit/?id=25209904a9cd368665cb4fbd8dc94ae7dd37f4de

Thanks,
Mike
Comment 3 Curtis Gedak 2016-10-19 16:24:21 UTC
This enhancement was included in the GParted 0.27.0 release on October 19, 2016.