Got rid of assert() in util.c by soft means

This commit is contained in:
Thomas Schmitt 2006-10-08 10:30:57 +00:00
parent 5f6b38dca6
commit ff7526deca

View File

@ -1,5 +1,8 @@
#include <string.h> #include <string.h>
#include <assert.h>
/* ts A61008 */
/* #include <a ssert.h> */
#include <stdlib.h> #include <stdlib.h>
#include "../version.h" #include "../version.h"
#include "util.h" #include "util.h"
@ -10,7 +13,10 @@ char *burn_strdup(char *s)
char *ret; char *ret;
int l; int l;
assert(s); /* ts A61008 */
/* a ssert(s); */
if (s == NULL)
return NULL;
l = strlen(s) + 1; l = strlen(s) + 1;
ret = malloc(l); ret = malloc(l);
@ -24,8 +30,11 @@ char *burn_strndup(char *s, int n)
char *ret; char *ret;
int l; int l;
assert(s); /* ts A61008 */
assert(n > 0); /* a ssert(s); */
/* a ssert(n > 0); */
if (s == NULL || n <= 0)
return NULL;
l = strlen(s); l = strlen(s);
ret = malloc(l < n ? l : n); ret = malloc(l < n ? l : n);