2008-05-21 Peter Maydell <pmaydell@chiark.greenend.org.uk>
+ * sbr/utils.c (mh_xrealloc): don't assume realloc() can
+ handle NULL pointers; some non-POSIX realloc()s can't.
+ (Ported from trunk.)
+
* sbr/dtimep.lex: add some table size declarations for the
benefit of elderly lexes with small defaults. (Ported from
trunk.)
{
void *memory;
+ /* Some non-POSIX realloc()s don't cope with realloc(NULL,sz) */
+ if (!ptr)
+ return mh_xmalloc(size);
+
if (size == 0)
adios(NULL, "Tried to realloc 0bytes");