Remove term_key, which was intended to handle function keys in a cross-
[u/mdw/putty] / puttymem.h
index b529c98..6ef3f79 100644 (file)
@@ -14,7 +14,7 @@
 #define smalloc(z) (mlog(__FILE__,__LINE__), safemalloc(z,1))
 #define snmalloc(z,s) (mlog(__FILE__,__LINE__), safemalloc(z,s))
 #define srealloc(y,z) (mlog(__FILE__,__LINE__), saferealloc(y,z,1))
-#define snrealloc(y,z) (mlog(__FILE__,__LINE__), saferealloc(y,z,s))
+#define snrealloc(y,z,s) (mlog(__FILE__,__LINE__), saferealloc(y,z,s))
 #define sfree(z) (mlog(__FILE__,__LINE__), safefree(z))
 void mlog(char *, int);
 #else
@@ -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