=================================================================== RCS file: /cvs/mandoc/dba.c,v retrieving revision 1.4 retrieving revision 1.6 diff -u -p -r1.4 -r1.6 --- mandoc/dba.c 2016/08/05 21:38:11 1.4 +++ mandoc/dba.c 2016/08/17 18:10:39 1.6 @@ -1,4 +1,4 @@ -/* $Id: dba.c,v 1.4 2016/08/05 21:38:11 schwarze Exp $ */ +/* $Id: dba.c,v 1.6 2016/08/17 18:10:39 schwarze Exp $ */ /* * Copyright (c) 2016 Ingo Schwarze * @@ -17,8 +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 @@ -169,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;