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

David Timber <[email protected]>
Newsgroups dev.linux.lists.exfat
Message-ID <[email protected]>
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

-- 
2.55.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.