$OpenBSD: patch-syck_h,v 1.2 2019/02/14 12:26:57 bluhm Exp $

Perl 5.28.1 no longer defines I_STDLIB and I_STRING in its config.h.
Zeroing allocated space avoids a perl segfault with malloc_flags J.

Index: syck.h
--- syck.h.orig
+++ syck.h
@@ -1,10 +1,4 @@
 #include "config.h"
-#ifdef I_STDLIB
-#define HAVE_STDLIB_H
-#endif
-#ifdef I_STRING
-#define HAVE_STRING_H
-#endif
 
 /*
  * syck.h
@@ -24,15 +18,8 @@
 #define SYCK_VERSION    "0.61"
 #define YAML_DOMAIN     "yaml.org,2002"
 
-#ifdef HAVE_STDLIB_H
 # include <stdlib.h>
-#endif
-
-#ifdef HAVE_STRING_H
 # include <string.h>
-#else
-# include <strings.h>
-#endif
 
 #ifdef HAVE_INTRINSICS_H
 # include <intrinsics.h>
@@ -76,7 +63,7 @@ extern "C" {
 
 #define ALLOC_CT 8
 #define SYCK_BUFFERSIZE 4096
-#define S_ALLOC_N(type,n) (type*)malloc(sizeof(type)*(n))
+#define S_ALLOC_N(type,n) (type*)calloc((n),sizeof(type))
 #define S_ALLOC(type) (type*)malloc(sizeof(type))
 #define S_REALLOC_N(var,type,n) (var)=(type*)realloc((char*)(var),sizeof(type)*(n))
 #define S_FREE(n) free(n); n = NULL;
