X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=sbr%2Futils.c;h=7dfe900b6cdc674ddad9e54169b559042f772da2;hp=bc171772c8a9b91b45941aafb370cbcbfa8b76e0;hb=008837e090c008e3afe7a9c8667070bafa091e62;hpb=81a21a9a97d8633f6d6231e31fdb6e328d0d3ff2 diff --git a/sbr/utils.c b/sbr/utils.c index bc17177..7dfe900 100644 --- a/sbr/utils.c +++ b/sbr/utils.c @@ -27,3 +27,18 @@ mh_xmalloc(size_t size) return memory; } + +void * +mh_xrealloc(void *ptr, size_t size) +{ + void *memory; + + if (size == 0) + adios(NULL, "Tried to realloc 0bytes"); + + memory = realloc(ptr, size); + if (!memory) + adios(NULL, "Realloc failed"); + + return memory; +}