From 26ad296a3104a934bff84c1e77b6f73508169959 Mon Sep 17 00:00:00 2001 From: Ralph Corderoy Date: Thu, 20 Oct 2016 00:08:50 +0100 Subject: [PATCH] Add LEN(s) definition. LEN gives the strlen() of string constant s, excluding the terminating NUL. --- h/mh.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/h/mh.h b/h/mh.h index 513248cf..3c2fb061 100644 --- a/h/mh.h +++ b/h/mh.h @@ -43,6 +43,10 @@ typedef unsigned char boolean; /* not int so we can pack in a structure */ #define NMH_UNUSED(i) i #endif +/* LEN gives the strlen() of string constant s, excluding the + * terminating NUL. */ +#define LEN(s) (sizeof (s) - 1) + /* * char array that keeps track of size in both bytes and characters * Usage note: -- 2.56.0