summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-07-22 04:39:34 +0800
committerkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-07-22 04:39:34 +0800
commit1357136003927f736b8d3e91c1970d4cc7861977 (patch)
treec3ae703bebaadc6d54926280fa0721718e50703f /include
parent290e94c252bf0d1b384b3775cd9de04f5afa341a (diff)
downloadpttbbs-1357136003927f736b8d3e91c1970d4cc7861977.tar
pttbbs-1357136003927f736b8d3e91c1970d4cc7861977.tar.gz
pttbbs-1357136003927f736b8d3e91c1970d4cc7861977.tar.bz2
pttbbs-1357136003927f736b8d3e91c1970d4cc7861977.tar.lz
pttbbs-1357136003927f736b8d3e91c1970d4cc7861977.tar.xz
pttbbs-1357136003927f736b8d3e91c1970d4cc7861977.tar.zst
pttbbs-1357136003927f736b8d3e91c1970d4cc7861977.zip
check the using of `sizeof' with strlcpy()
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@432 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'include')
-rw-r--r--include/bbs.h13
1 files changed, 12 insertions, 1 deletions
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 <limits.h>
#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 */