]> granicus.if.org Git - onig/commitdiff
check 0 in ME_STATUS_ON_AT()
authorK.Kosako <kosako@sofnec.co.jp>
Wed, 28 Jun 2017 06:23:42 +0000 (15:23 +0900)
committerK.Kosako <kosako@sofnec.co.jp>
Wed, 28 Jun 2017 06:23:42 +0000 (15:23 +0900)
src/regint.h

index 34b962df752531a32f1f0fa36f5f0f9eee6ac7b5..eec2918755a3d0770ae1b3a7e22212e5815fce43 100644 (file)
@@ -251,8 +251,10 @@ typedef unsigned int  MemStatusType;
   ((n) > 0 && (n) < (int )MEM_STATUS_BITS_NUM  ?  ((stats) & ((MemStatusType )1 << n)) : ((stats) & 1))
 
 #define MEM_STATUS_ON_AT(stats,n) do {\
-    if ((n) < (int )MEM_STATUS_BITS_NUM)       \
-    (stats) |= ((MemStatusType )1 << (n));\
+  if ((n) < (int )MEM_STATUS_BITS_NUM) {\
+    if ((n) != 0)\
+      (stats) |= ((MemStatusType )1 << (n));\
+  }\
   else\
     (stats) |= 1;\
 } while (0)