chiark / gitweb /
Silence two -Wlogical-op warnings.
authorWerner Koch <wk@gnupg.org>
Thu, 5 Jan 2017 19:42:55 +0000 (20:42 +0100)
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Tue, 3 Jan 2017 20:39:52 +0000 (20:39 +0000)
* common/tlv.c (parse_ber_header): Avoid compiler warning about a
duplicate condition.
* tools/gpgtar-create.c (pattern_valid_p): Likewise.

Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit 6170eb809033c9d144abf3b1f31f8b936878cdd4)

Gbp-Pq: Name 0024-Silence-two-Wlogical-op-warnings.patch

common/tlv.c
tools/gpgtar-create.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--)
index ef906a5dd52be205d51182e67ddf44827df379f7..ffd239f4271f37b00c9934c09092932f79cfbc4a 100644 (file)
@@ -429,7 +429,11 @@ pattern_valid_p (const char *pattern)
     return 0;
   if (*pattern == '.' && pattern[1] == '.')
     return 0;
-  if (*pattern == '/' || *pattern == DIRSEP_C)
+  if (*pattern == '/'
+#ifdef HAVE_DOSISH_SYSTEM
+      || *pattern == '\\'
+#endif
+      )
     return 0; /* Absolute filenames are not supported.  */
 #ifdef HAVE_DRIVE_LETTERS
   if (((*pattern >= 'a' && *pattern <= 'z')