From 1357136003927f736b8d3e91c1970d4cc7861977 Mon Sep 17 00:00:00 2001 From: kcwu Date: Sun, 21 Jul 2002 20:39:34 +0000 Subject: check the using of `sizeof' with strlcpy() git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@432 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- include/bbs.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'include/bbs.h') diff --git a/include/bbs.h b/include/bbs.h index 7d2ef8d1..023ac1a2 100644 --- a/include/bbs.h +++ b/include/bbs.h @@ -49,5 +49,16 @@ #else #include #endif - +#ifdef DEBUG +static int Sizeof(char *what,int size,char *file,int line) +{ + if(size==4) + printf("WARRNING\r\n"); + printf("%s(%d): sizeof(%s)=%d\r\n",file,line,what,size); + return size; +} +#define SIZEOF(a) Sizeof(#a,sizeof(a),__FILE__,__LINE__) +#else +#define SIZEOF(a) sizeof(a) +#endif #endif /* INCLUDE_BBS_H */ -- cgit v1.2.3