Skip to content
Myr

sprintf: warning fixes

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Sean Barrett · committed by Sean Barrett · parent 6b38abe · Browse files · 1 file+5 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+5 added−4 removed

  • other:+5 added−4 removed

1 file+5 added−4 removed

modified:stb_sprintf.h+5 added-4 removed
1361 unmodified lines
1362 int length;1363 char tmp[STB_SPRINTF_MIN];1364} stbsp__context;13651366static char *stbsp__clamp_callback(char *buf, void *user, int len)1366static char *stbsp__clamp_callback(const char *buf, void *user, int len)1367{1368 stbsp__context *c = (stbsp__context *)user;1369 c->length += len;1370
1 unmodified line
1372 len = c->count;13731374 if (len) {1375 if (buf != c->buf) {1376 char *s, *d, *se;1376 const char *s, *se;1377 char *d;1378 d = c->buf;1379 s = buf;1380 se = buf + len;1381 do {
8 unmodified lines
1390 return c->tmp;1391 return (c->count >= STB_SPRINTF_MIN) ? c->buf : c->tmp; // go direct into buffer if you can1392}13931393static char * stbsp__count_clamp_callback( char * buf, void * user, int len )1394static char * stbsp__count_clamp_callback( const char * buf, void * user, int len )1395{1395 (void) buf;1396 stbsp__context * c = (stbsp__context*)user;1397 (void) sizeof(buf);13981399 c->length += len;1400 return c->tmp; // go direct into buffer if you can1401}
478 unmodified lines