patch-dfasyn_n2d_h 549 B

12345678910111213
  1. $OpenBSD: patch-dfasyn_n2d_h,v 1.1 2005/12/16 22:17:26 cathcart Exp $
  2. --- dfasyn/n2d.h.orig Fri Dec 16 22:09:17 2005
  3. +++ dfasyn/n2d.h Fri Dec 16 22:09:27 2005
  4. @@ -31,7 +31,7 @@
  5. #include <stdlib.h>
  6. #include <string.h>
  7. -#define new(T) ((T *) malloc(sizeof(T)))
  8. +#define new(T) ((T *) calloc(1, sizeof(T)))
  9. #define new_array(T,N) ((T *) malloc((N) * sizeof(T)))
  10. #define resize_array(T,arr,newN) ((T *) ((arr) ? realloc(arr,(newN)*sizeof(T)) : malloc((newN)*sizeof(T))))
  11. #define new_string(s) strcpy((char *)malloc((strlen(s)+1)*sizeof(char)),s)