From 793d466edfa715e29b1d6141f42a7a837c4f446a Mon Sep 17 00:00:00 2001 From: John Tytgat Date: Sun, 25 May 2008 15:51:30 +0000 Subject: - introduction of SLEN() - enforce result of url_normalize() being NULL on failure - plug memory leak when url_normalize() fails svn path=/trunk/netsurf/; revision=4200 --- utils/utils.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'utils/utils.h') diff --git a/utils/utils.h b/utils/utils.h index 8f3516e1d..4eb921e3f 100644 --- a/utils/utils.h +++ b/utils/utils.h @@ -40,6 +40,14 @@ #define max(x,y) (((x)>(y))?(x):(y)) #endif +/** + * Calculate length of constant C string. + * + * \param x a constant C string. + * \return the length of C string without its terminating NUL accounted. + */ +#define SLEN(x) (sizeof((x)) - 1) + enum query_response { QUERY_CONTINUE, QUERY_YES, -- cgit v1.2.3