/*----- Licensing notice --------------------------------------------------*
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * This file is part of the mLib utilities library.
*
- * This program is distributed in the hope that it will be useful,
+ * mLib is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * mLib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * GNU Library General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * You should have received a copy of the GNU Library General Public
+ * License along with mLib; if not, write to the Free
+ * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+ * MA 02111-1307, USA.
*/
/*----- Header files ------------------------------------------------------*/
#include <unistd.h>
+#include "alloc.h"
#include "mdup.h"
/*----- Data structures ---------------------------------------------------*/
#include <stdarg.h>
#include <stdio.h>
+#include "macros.h"
+
#define D(x) x
-static void dump(mdup_fdinfo *v, size_t n, mdup_fdinfo *dhead,
- const char *fmt, ...)
+static PRINTF_LIKE(4, 5) IGNORABLE
+ void dump(mdup_fdinfo *v, size_t n, mdup_fdinfo *dhead,
+ const char *fmt, ...)
{
int i;
mdup_fdinfo *f, *g;
* way.
*/
- if ((vv = malloc(sizeof(*vv) * n)) == 0)
+ if (!NEWV_SAFE_P(vv, n) || (vv = malloc(n*sizeof(*vv))) == 0)
return (-1);
dhead = 0;