chiark / gitweb /
Silence two -Wlogical-op warnings.
[gnupg2.git] / common / tlv.c
index 6813c585afb70b35367317dd3854b6a2c36085ee..0058b67ca19fee3fbbfb84498910c21c71da9d22 100644 (file)
@@ -214,9 +214,9 @@ parse_ber_header (unsigned char const **buffer, size_t *size,
   else
     {
       unsigned long len = 0;
-      int count = c & 0x7f;
+      int count = (c & 0x7f);
 
-      if (count > sizeof (len) || count > sizeof (size_t))
+      if (count > (sizeof(len)<sizeof(size_t)?sizeof(len):sizeof(size_t)))
         return gpg_err_make (default_errsource, GPG_ERR_BAD_BER);
 
       for (; count; count--)