=================================================================== RCS file: /cvs/mandoc/dba.c,v retrieving revision 1.3 retrieving revision 1.6 diff -u -p -r1.3 -r1.6 --- mandoc/dba.c 2016/07/29 15:29:32 1.3 +++ mandoc/dba.c 2016/08/17 18:10:39 1.6 @@ -1,4 +1,4 @@ -/* $Id: dba.c,v 1.3 2016/07/29 15:29:32 schwarze Exp $ */ +/* $Id: dba.c,v 1.6 2016/08/17 18:10:39 schwarze Exp $ */ /* * Copyright (c) 2016 Ingo Schwarze * @@ -17,7 +17,16 @@ * Allocation-based version of the mandoc database, for read-write access. * The interface is defined in "dba.h". */ +#include "config.h" + #include +#if HAVE_ENDIAN +#include +#elif HAVE_SYS_ENDIAN +#include +#elif HAVE_NTOHL +#include +#endif #include #include #include @@ -168,7 +177,7 @@ dba_page_add(struct dba_array *page, int32_t ie, const if (ie == DBP_ARCH) { if (entries == NULL) return; - if (str == NULL) { + if (str == NULL || *str == '\0') { dba_array_free(entries); dba_array_set(page, DBP_ARCH, NULL); return;