summaryrefslogtreecommitdiff
path: root/tests/t-printf.c
Commit message (Collapse)AuthorAgeFilesLines
* Add more tests for t-printf and t-strerror.pengyi2022-12-131-0/+25
| | | | | | | | | | | | | | * tests/t-printf.c (check_fwrite): New. (main): Add check_fwrite. * tests/t-strerror.c (main): Add three more cases to LIST. -- The string in check_fwrite is from the Gateless Gate, for people who want to discuss "Niente". --- gniibe Co-authored-by: NIIBE Yutaka <gniibe@fsij.org> Signed-off-by: "pengyi" <pengyi37@huawei.com>
* estream: Use correct POSIX name THOUSEP.Werner Koch2018-12-121-0/+3
| | | | | | | | | | | * src/estream-printf.c: Replace HAVE_LANGINFO_THOUSANDS_SEP by HAVE_LANGINFO_THOUSEP. (pr_integer): Use THOUSEP. -- GnuPG-bug-id: 4286 Reported-by: miod Signed-off-by: Werner Koch <wk@gnupg.org>
* core: New functions gpgrt_fprintf_sf anf gpgrt_fprintf_sf_unlocked.Werner Koch2018-11-261-0/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/gpg-error.h.in (gpgrt_string_filter_t): New type. (gpgrt_fprintf_sf, gpgrt_fprintf_sf_unlocked): New. * src/gpg-error.vers, src/gpg-error.def.in: Add them. * src/visibility.c (gpgrt_fprintf_sf): New. (gpgrt_fprintf_sf_unlocked): New. * src/estream-printf.c (pr_string): Add and use args sf, sfvalue and string_no. (do_format): Add args sf and sfvalue. Keep a string format counter. (_gpgrt_estream_format): Add args sf and sfvalue. Change all callers to provide NULL for them. * src/estream.c (_gpgrt_vfprintf_unlocked, _gpgrt_vfprintf): Add sf and sfvalue and adjust all callers. (do_print_stream): Ditto. * tests/t-printf.c (stream_to_string): New. (struct sfstate_s): New. (string_filter): New. (check_fprintf_sf): New. (main): Call new test. -- The actual reason to implement these functions is to enhance the internal logging function with a filter to sanitized strings so that control values or other things can be quoted. Signed-off-by: Werner Koch <wk@gnupg.org>
* Convert http links to https where possible in the source.Daniel Kahn Gillmor2016-02-081-1/+1
| | | | | | | | | | | | | | | | -- * use https for bug reporting * in comments and docs, use https to refer to: - www.gnu.org - creativecommons.org - translationproject.org - mail.gnome.org - www.perl.org - www.ctan.org - www.cl.cam.ac.uk - www.ntg.nl - cygwin.com - www.ethnologue.com
* Add test for the estream printf functionsWerner Koch2014-08-251-0/+429
* tests/t-printf.c: New. * configure.ac: Check for vasprintf. -- These tests have been taken from Libestream and changed to be more portable. For example there is only va_start per function and the test return an error only for _GLIBC_ based systems because that is what we compare against.