X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/39439af6f686d26bc94f8b8c1c7a1965564b4a47..9c3b78f422dbffc8fcd93fd2743f75fca45a926a:/puttymem.h diff --git a/puttymem.h b/puttymem.h index 06c294d9..6ef3f794 100644 --- a/puttymem.h +++ b/puttymem.h @@ -37,6 +37,7 @@ void safefree(void *); */ #define snew(type) ((type *)snmalloc(1, sizeof(type))) #define snewn(n, type) ((type *)snmalloc((n), sizeof(type))) -#define sresize(ptr, n, type) ((type *)snrealloc((ptr), (n), sizeof(type))) +#define sresize(ptr, n, type) \ + ((type *)snrealloc((sizeof((type *)0 == (ptr)), (ptr)), (n), sizeof(type))) #endif