Commit Graph

78 Commits

Author SHA1 Message Date
Sean Barrett 1ee679ca2e update version numbers 2021-07-11 17:07:54 -07:00
Fabian Giesen d2476c3845 stb_sprintf: GCC compilation fix
Fixes issue #1010.
2021-07-08 00:21:08 -07:00
Fabian Giesen 06b6009e3b stb_sprintf: Fix unused variable warning with STB_SPRINTF_NOFLOAT
Fixes issue #986.
2021-07-07 15:51:56 -07:00
Fabian Giesen 3be65f1c0c stb_sprintf: Small simplification
This was intentional but we might as well just set cs=0
directly here.

Fixes issue #997.
2021-07-07 15:43:47 -07:00
Fabian Giesen 013884b53b stb_sprintf: Fix string length calc
Factor out string length computation into helper func, comment
it a bit more, always use a limit to avoid 32b unsigned overflow,
and avoid reading past the bounds of non-0-terminated strings given
with specified precision.

Fixes issue #966.
2021-07-07 15:38:42 -07:00
Fabian Giesen 46c259ff90 stb_sprintf: PUBLICDEC on declarations, as intended
The code was using PUBLICDEF on both declarations and
definitions.

Fixes issue #458.
2021-07-07 03:32:04 -07:00
Doj 067655993a stb_sprintf: fix stbsp_ddtoS64 macro
Should use xh argument not ph (which is the name of the
variable that it actually gets instantiated with the
one time it is used).
2021-07-04 01:38:24 -07:00
Rafael Sachetto 02578923d3 Fix compilation warnings in the s390x architeture. Fixes #1082. 2021-07-04 01:38:24 -07:00
Valentin Lenhart 2de22bde0a stb_sprintf.h: stdlib.h is not needed
va_arg() is in stdarg.h, which is already being included
2021-07-04 01:38:24 -07:00
Michael Aganier 696cb038a3 stb_sprintf: add attribute format to variadic functions
This allows for compiler verification of the format string
just like printf.
2021-07-04 01:38:24 -07:00
Sean Barrett 314d0a6f9a update version numbers 2020-07-13 04:36:03 -07:00
Sean Barrett a2c91804a3 stb_sprintf: avoid clang -O3 misaligned access 2020-02-06 05:36:53 -08:00
Sean Barrett 37b9b20fde update version numbers 2020-02-05 03:19:08 -08:00
Sean Barrett 2805fe39ab Merge branch 'fix_ub_shift' of https://github.com/wojdyr/stb into working 2020-02-05 03:15:56 -08:00
Sean Barrett cb9d4e9547 sprintf: warning fixes 2020-02-05 03:15:41 -08:00
Sean Barrett 6b38abed1f Merge branch 'mine/avoid_warning' of https://github.com/wojdyr/stb into working 2020-02-05 03:10:20 -08:00
Sean Barrett f06f586d18 sprintf warnings 2020-02-05 03:10:07 -08:00
Marcin Wojdyr 3366d1e797 stb_sprintf: avoid left shift of negative value
fix undefined behaviour reported by UBSan:
  runtime error: left shift of negative value -9223372036854775808
and add a test case.

fixes #800
2020-02-03 20:17:03 +01:00
Marcin Wojdyr 3bb12a14e9 stb_sprintf.h: fix unused-parameter warning 2020-02-03 14:42:35 +01:00
Sean Barrett 5e4a0617b7 udpate version numbers 2020-02-02 11:12:13 -08:00
Sean Barrett ca1b58154d Merge branch 'working' into work2 2020-02-02 09:45:56 -08:00
Sean Barrett acd1c66aa4 Merge branch 'fix806' of https://github.com/kolbma/stb into work2 2020-02-02 09:45:35 -08:00
Sean Barrett e943476f7f stb_sprintf: support hh 2020-02-02 08:04:34 -08:00
Sean Barrett 3f5db89baf stb_sprintf: redo ASAN fixes after problematic merge 2020-02-02 07:49:41 -08:00
Sean Barrett e802821e4d stb_sprintf: PR 613 2020-02-02 07:47:53 -08:00
Sean Barrett c716696e28 Merge branch 'stb_sprintf-asan' of https://github.com/h-s-c/stb into work2 2020-02-02 07:11:57 -08:00
arlecchino 117e1741a2
stb_printf - added contributor 2019-11-05 17:43:20 +01:00
arlecchino b97d06e0fa
fix: stb_sprintf - gcc defines __powerpc64__
Fix for stb_sprintf https://github.com/nothings/stb/issues/806
fixes #806
2019-11-05 17:39:22 +01:00
Sean Barrett 63b59b46b0 update version numbers 2019-02-07 10:03:00 -08:00
Sean Barrett a23f466de0 "long int" => "long" 2019-02-07 09:49:08 -08:00
Sean Barrett f11f1e801a stb_sprintf: credits 2019-02-07 09:23:01 -08:00
Sean Barrett 08759eb405 Merge branch 'fix-sprintf-int-size-1' of https://github.com/account-login/stb into working 2019-02-07 09:22:06 -08:00
Sean Barrett 9643f6bd98 stb_sprintf: fix unaligned digitpair[], fix some signed-right-shifts 2019-02-07 08:45:19 -08:00
Sean Barrett 82310cc5ff stb_sprintf: fix unaligned digitpair[], fix some signed-right-shifts 2019-02-07 08:44:39 -08:00
Sean Barrett 619cdb6a3b stb_sprintf: fix 32 vs 64-bit sizes for format widts j/z/t 2019-02-07 07:53:28 -08:00
Sean Barrett 6e7e5c5787 Merge branch 'fix-unaligned' of https://github.com/stefano-zanotti-88/stb into working 2019-02-07 07:41:53 -08:00
Sean Barrett 3005bcfe87 Merge branch 'misc-typos' of https://github.com/luzpaz/stb into working 2019-02-07 05:00:12 -08:00
Sean Barrett 9f1ef73e96 stb_sprintf: minor reformatting 2019-02-07 04:40:32 -08:00
root eccee04e5a stb_sprintf: fix integer size for %ld 2018-11-09 22:49:33 +08:00
Stefano Zanotti 05b45da629
stb_sprintf: fix unaligned access
Fix an unaligned 32-bit access even if STB_SPRINTF_NOUNALIGNED was defined.
2018-06-27 10:37:00 +02:00
luz.paz 622b3adad3 Misc. comment typos
Found via `codespell -q 3`
2018-02-12 14:54:22 -05:00
Sean Barrett 01daa3a244 stb_sprintf: fix size-only snprintf query 2018-01-30 05:29:31 -08:00
Sean Barrett ee0ebfc79b version numbers 2018-01-29 04:59:32 -08:00
Sean Barrett da4a7a1d6f Merge branch 'patch-2' of https://github.com/wojdyr/stb 2018-01-29 03:51:23 -08:00
Sean Barrett 5f1a73fe4e credits, tests 2018-01-29 03:18:40 -08:00
Sean Barrett e5946524d7 Merge branch 'patch-1' of https://github.com/wojdyr/stb 2018-01-29 03:15:17 -08:00
Marcin Wojdyr 3a969eb64c
remove duplicated `pr = 0`
avoid warning:
Variable 'pr' is reassigned a value before the old one has been used
caused by:

    fw = pr = fl = 0;
    ...
    pr = 0;
2017-12-07 15:30:43 +00:00
Marcin Wojdyr 7d80a8b44d avoid GCC7 implicit-fallthrough warning
(GCC recognizes certain strings in comments)
2017-08-11 00:19:18 +01:00
Rohit Nirmal 747b8d8f71 stb_sprintf.h: Don't compare uninitialized value when using zero.
This prevents a "Conditional jump or move depends on uninitialised
value(s)" error from valgrind when using zero as an argument in line
1045.
2017-07-28 00:01:46 -05:00
Sean Barrett 555efbedfc Update version numbers 2017-07-23 14:09:39 -07:00