Merge branch 'fix-unaligned' of https://github.com/stefano-zanotti-88/stb into working

master
Sean Barrett ago%!(EXTRA string=6 years)
commit 6e7e5c5787
  1. 12
      stb_sprintf.h

@ -334,7 +334,17 @@ STBSP__PUBLICDEF int STB_SPRINTF_DECORATE(vsprintfcb)(STBSP_SPRINTFCB *callback,
if (callback)
if ((STB_SPRINTF_MIN - (int)(bf - buf)) < 4)
goto schk1;
*(stbsp__uint32 *)bf = v;
#ifdef STB_SPRINTF_NOUNALIGNED
if(((stbsp__uintptr)bf) & 3) {
bf[0] = f[0];
bf[1] = f[1];
bf[2] = f[2];
bf[3] = f[3];
} else
#endif
{
*(stbsp__uint32 *)bf = v;
}
bf += 4;
f += 4;
}

Loading…
Cancel
Save