diff options
author | Xavier Roche <xroche@users.noreply.github.com> | 2013-08-15 12:15:04 +0000 |
---|---|---|
committer | Xavier Roche <xroche@users.noreply.github.com> | 2013-08-15 12:15:04 +0000 |
commit | 86035dd001230d41c46c07b07d746392f51f623e (patch) | |
tree | 85b91d7b44ac8dc7e9254f3a4baaabda3c64ee06 | |
parent | b85c80754492d8a360d2e45af14bfbc0d7bf1b46 (diff) |
Lenient strnotempty() function (ie. accepting NULL)
-rw-r--r-- | src/htsglobal.h | 4 |
1 files changed, 2 insertions, 2 deletions
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 |