From 86035dd001230d41c46c07b07d746392f51f623e Mon Sep 17 00:00:00 2001 From: Xavier Roche Date: Thu, 15 Aug 2013 12:15:04 +0000 Subject: Lenient strnotempty() function (ie. accepting NULL) --- src/htsglobal.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/htsglobal.h b/src/htsglobal.h index 5085865..99db597 100644 --- a/src/htsglobal.h +++ b/src/htsglobal.h @@ -279,8 +279,8 @@ Please visit our Website: http://www.httrack.com #define maximum(A,B) ( (A) > (B) ? (A) : (B) ) #define minimum(A,B) ( (A) < (B) ? (A) : (B) ) -/* chaine vide? */ -#define strnotempty(A) (((A)[0]!='\0') ? 1 : 0) +/* chaine no empty ? (and not null) */ +#define strnotempty(A) (((A) != NULL && (A)[0] != '\0')) /* optimisation inline si possible */ #ifdef __cplusplus -- cgit v1.2.3