diff options
| author | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2022-05-24 22:07:47 +0200 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2022-05-24 22:20:04 +0200 |
| commit | 132d8c860eab54f95596780b005c97fd05fc277f (patch) | |
| tree | 2394554e3c5b189c452b0be51e76d7def7aa0361 /src | |
| parent | 77d16c32cca9f5cd7c5badb495f37a01402e5931 (diff) | |
| download | rts-132d8c860eab54f95596780b005c97fd05fc277f.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.c | 8 |
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; |
