Skip to content

exfatprogs: remove sscanf(), add "make check" support

David Timber exfat 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 5 repliesIn review
  2. v12 patches 1 replySuperseded

Changes from v0 from the cover letter

- confirmed no behaviour change in exfat_parse_ulong() according to the x86 disassembly (other than saved_errno)
- boolean environment variables now accept non-decimal integer values (updated commit message clear up the confusion for reviewers)
- trailing garbage characters after an integer value in boolean environment variables are now rejected(this is the intended behaviour Suggested-by: Hyunchul Lee <[email protected]>)
- make check now runs test programs in lib/tests/

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2libexfat: remove use of sscanf()include/libexfat.h lib/Makefile.am lib/libexfat.c +1 more+222 -422 replies
2/2treewide: run internal library tests in "make check".github/workflows/c-cpp.yml configure.ac lib/Makefile.am +1 more+9 -53 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/2] exfatprogs: remove sscanf(), add "make check" support

continued from Github PR #386

Changes from v0:

- confirmed no behaviour change in exfat_parse_ulong() according to the x86 disassembly (other than saved_errno)
- boolean environment variables now accept non-decimal integer values (updated commit message clear up the confusion for reviewers)
- trailing garbage characters after an integer value in boolean environment variables are now rejected(this is the intended behaviour Suggested-by: Hyunchul Lee <[email protected]>)
- make check now runs test programs in lib/tests/

    (./configure --enable-tests not required)

- Run make check in Github Actions
- Add missing comma in configure.ac

The previous implementation of exfat_cmp_kernel_ver() misbehaves in some cases and this is why we should move away from *scanf(). The change in behaviour is intentional and correct.

There's no regression in exfat_cmp_kernel_ver() for Linux kernel version strings because the Linux kernel always returns the version in 3 numbers (make kernelversion). The new implementation is the one I originally intended. The test case should cover all the possible sane values for kernel version strings.

David Timber (2):
libexfat: remove use of sscanf()
treewide: run internal library tests in "make check"

 .github/workflows/c-cpp.yml |   2 +-
 configure.ac                |   2 +-
 include/libexfat.h          |  41 ++++++++++++-
 lib/Makefile.am             |  10 ++-
 lib/libexfat.c              | 117 ++++++++++++++++++++++++------------
 lib/tests/run-all.sh        |   3 +
 lib/tests/suite0001-parse.c | 101 +++++++++++++++++++++++++++++++
 7 files changed, 230 insertions(+), 46 deletions(-)
 create mode 100644 lib/tests/suite0001-parse.c
Signature · 1 line
2.55.0