From ff7526decaac045d5c5f12fab2b6a8d6aad10cd2 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sun, 8 Oct 2006 10:30:57 +0000 Subject: [PATCH] Got rid of assert() in util.c by soft means --- trunk/libburn/util.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/trunk/libburn/util.c b/trunk/libburn/util.c index cad28587..b759dc37 100644 --- a/trunk/libburn/util.c +++ b/trunk/libburn/util.c @@ -1,5 +1,8 @@ #include -#include + +/* ts A61008 */ +/* #include */ + #include #include "../version.h" #include "util.h" @@ -10,7 +13,10 @@ char *burn_strdup(char *s) char *ret; int l; - assert(s); + /* ts A61008 */ + /* a ssert(s); */ + if (s == NULL) + return NULL; l = strlen(s) + 1; ret = malloc(l); @@ -24,8 +30,11 @@ char *burn_strndup(char *s, int n) char *ret; int l; - assert(s); - assert(n > 0); + /* ts A61008 */ + /* a ssert(s); */ + /* a ssert(n > 0); */ + if (s == NULL || n <= 0) + return NULL; l = strlen(s); ret = malloc(l < n ? l : n);