summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2020-10-24 13:51:06 +0200
committerTyge Løvset <[email protected]>2020-10-24 13:51:06 +0200
commit071d3d1e2e6d2e1ed8a4bf92db86ef407cc454c0 (patch)
treea74e13f484ab3ae6693a991173acb71ba6e5ed10
parent5e2366ced5cf1a52bfe69955f705fa98a250f56d (diff)
downloadSTC-modified-071d3d1e2e6d2e1ed8a4bf92db86ef407cc454c0.tar.gz
STC-modified-071d3d1e2e6d2e1ed8a4bf92db86ef407cc454c0.zip
% no longer needed to be 'escaped' with %. now behaves as any chars.
-rw-r--r--stc/cfmt.h9
1 files 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;