aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2022-05-24 22:07:47 +0200
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2022-05-24 22:20:04 +0200
commitf34113de515522dd76709403be5015698c6fbd29 (patch)
tree48f5d31b1ab571642082c99282c12ab434b61d78 /src
parent0bcea86763c6858a4e3b18bf8062739e15032474 (diff)
downloadjancity-f34113de515522dd76709403be5015698c6fbd29.tar.gz
Use realloc(3) directly
It is simply not true realloc(3) cannot be used with NULL pointers.
Diffstat (limited to 'src')
-rw-r--r--src/gfx/sdl-1.2/src/env.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/gfx/sdl-1.2/src/env.c b/src/gfx/sdl-1.2/src/env.c
index d77503d..18cfe95 100644
--- a/src/gfx/sdl-1.2/src/env.c
+++ b/src/gfx/sdl-1.2/src/env.c
@@ -27,13 +27,7 @@ static struct
void gfx_register_sprite(struct sprite *const s)
{
- /* realloc(3) could had been used directly, but Win9x relies on
- * a C89/C90 library implementation, where calling realloc(3)
- * with a NULL pointer is undefined behaviour. */
- if (!list)
- list = malloc(sizeof *list);
- else
- list = realloc(list, (list_len + 1) * sizeof *list);
+ list = realloc(list, (list_len + 1) * sizeof *list);
if (list)
list[list_len++] = s;