From 5d0b8265b247290460ba8011356e88498d8c91f1 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 --- libburn/util.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/libburn/util.c b/libburn/util.c index cad2858..b759dc3 100644 --- a/libburn/util.c +++ b/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);