SDL/src/stdlib
Ozkan Sezer b6899f82fb SDL_iconv_string: simplify recomputation of outbuf and outbytesleft
Noticed this in SDL-1.2 where gcc-13 emits a -Wuse-after-free warning.
No such warning in SDL2 and SDL3, because unlike SDL1.2, SDL_realloc()
is not a macro expanding to libc realloc(). It warns, of course, if
SDL_realloc() is replaced with plain realloc():

src/stdlib/SDL_iconv.c: In function 'SDL_iconv_string_REAL':
src/stdlib/SDL_iconv.c:824:39: warning: pointer 'oldstring' may be used after 'realloc' [-Wuse-after-free]
  824 |             outbuf = string + (outbuf - oldstring);
      |                               ~~~~~~~~^~~~~~~~~~~~
src/stdlib/SDL_iconv.c:818:30: note: call to 'realloc' here
  818 |             string = (char *)realloc(string, stringsize + sizeof(Uint32));
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

(cherry picked from commit 2205626816)
2024-05-10 18:56:24 +03:00
..
SDL_crc16.c Updated copyright for 2024 2024-01-01 13:19:49 -08:00
SDL_crc32.c Updated copyright for 2024 2024-01-01 13:19:49 -08:00
SDL_getenv.c Updated copyright for 2024 2024-01-01 13:19:49 -08:00
SDL_iconv.c SDL_iconv_string: simplify recomputation of outbuf and outbytesleft 2024-05-10 18:56:24 +03:00
SDL_malloc.c Updated copyright for 2024 2024-01-01 13:19:49 -08:00
SDL_mslibc.c Updated copyright for 2024 2024-01-01 13:19:49 -08:00
SDL_qsort.c Prevent asan warning on qsort(): 2024-01-20 11:26:37 +01:00
SDL_stdlib.c Updated copyright for 2024 2024-01-01 13:19:49 -08:00
SDL_string.c Updated copyright for 2024 2024-01-01 13:19:49 -08:00
SDL_strtokr.c Updated copyright for 2024 2024-01-01 13:19:49 -08:00
SDL_vacopy.h Updated copyright for 2024 2024-01-01 13:19:49 -08:00