From 071d3d1e2e6d2e1ed8a4bf92db86ef407cc454c0 Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Sat, 24 Oct 2020 13:51:06 +0200 Subject: % no longer needed to be 'escaped' with %. now behaves as any chars. --- stc/cfmt.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/stc/cfmt.h b/stc/cfmt.h index 6e4f4fcc..7a3ea90a 100644 --- a/stc/cfmt.h +++ b/stc/cfmt.h @@ -28,10 +28,8 @@ // https://gist.github.com/alexameen/6550d892338626964a870e408d1e8912 // https://gist.github.com/alexameen/4440e4bcad557a464dcc9ff884763049 -STC_API void -_cfmt_printf(int s, const char* fmt, ...); -STC_API char * -_cfmt_conv(int nargs, const char *fmt, ...); +STC_API void _cfmt_printf(int s, const char* fmt, ...); +STC_API char* _cfmt_conv(int nargs, const char *fmt, ...); enum {_cfmt_bn=4, _cfmt_sn=64}; STC_INLINE const char* _cfmt_strftime(char* n, char buf[][_cfmt_sn], size_t maxsize, const char *fmt, const struct tm *timeptr) { if (*n >= _cfmt_bn) return fmt; @@ -171,8 +169,7 @@ _cfmt_conv(int nargs, const char *fmt, ...) { do { switch ((ch = *fmt)) { case '%': - if (fmt[1] == '%') *p++ = *fmt++; - else fprintf(stderr, "ERROR: c_printf() illegal unescaped %%: %s\n", fmt0); + *p++ = '%'; break; case '}': if (fmt[1] == '}') ++fmt; -- cgit v1.2.3