diff options
| author | Tyge Løvset <[email protected]> | 2020-10-24 13:51:06 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2020-10-24 13:51:06 +0200 |
| commit | 071d3d1e2e6d2e1ed8a4bf92db86ef407cc454c0 (patch) | |
| tree | a74e13f484ab3ae6693a991173acb71ba6e5ed10 | |
| parent | 5e2366ced5cf1a52bfe69955f705fa98a250f56d (diff) | |
| download | STC-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.h | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -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;
|
