Format string refactor
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user