Format string refactor

This commit is contained in:
Krzosa Karol
2025-11-27 23:13:28 +01:00
parent e9e8751981
commit d72485a137
24 changed files with 80 additions and 116 deletions
+7 -6
View File
@@ -574,11 +574,6 @@ STBSP__PUBLICDEF int STB_SPRINTF_DECORATE(vsprintfcb)(STBSP_SPRINTFCB *callback,
char num[STBSP__NUMSZ];
char lead[8];
char tail[8];
struct stb__string {
char *data;
int64_t len;
} S;
char *s;
char const *h;
stbsp__uint32 l, n, cs;
@@ -588,6 +583,11 @@ STBSP__PUBLICDEF int STB_SPRINTF_DECORATE(vsprintfcb)(STBSP_SPRINTFCB *callback,
#endif
stbsp__int32 dp;
char const *sn;
struct stb__string {
char *data;
int64_t len;
};
struct stb__string S;
case 'S':
// get the string
@@ -596,7 +596,8 @@ STBSP__PUBLICDEF int STB_SPRINTF_DECORATE(vsprintfcb)(STBSP_SPRINTFCB *callback,
S.data = (char *)"null";
S.len = 4;
}
l = (unsigned int)S.len;
s = S.data;
l = stbsp__strlen_limited(S.data, ((int)S.len >= 0) ? (int)S.len : ~0u);
lead[0] = 0;
tail[0] = 0;
pr = 0;