[git] GnuPG - branch, master, updated. gnupg-2.1.15-100-g9da780e

by Werner Koch cvs at cvs.gnupg.org
Tue Sep 13 08:29:55 CEST 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU Privacy Guard".

The branch, master has been updated
       via  9da780e5c4b32ea81ba47bf36f17100d208b8b4f (commit)
      from  31fc420727f45dd081f8ad5d056da6675dad29f2 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 9da780e5c4b32ea81ba47bf36f17100d208b8b4f
Author: Werner Koch <wk at gnupg.org>
Date:   Tue Sep 13 08:26:56 2016 +0200

    tools: Minor fix to the usbmon debugging tool.
    
    --
    * tools/ccidmon.c (GNUPG_NAME): Define if not defined.
    (digitp, hexdigitp): Change to our common semantics.
    
    --
    Note that this tool only exists in the repo.
    
    GnuPG-bug-id: 2678
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/tools/ccidmon.c b/tools/ccidmon.c
index 4e39b5c..92673f4 100644
--- a/tools/ccidmon.c
+++ b/tools/ccidmon.c
@@ -45,6 +45,9 @@
 # define PACKAGE_BUGREPORT "devnull at example.org"
 #endif
 #define PGM "ccidmon"
+#ifndef GNUPG_NAME
+# define GNUPG_NAME "GnuPG"
+#endif
 
 /* Option flags. */
 static int verbose;
@@ -94,10 +97,10 @@ enum {
 };
 
 
-#define digitp(p)   ((p) >= '0' && (p) <= '9')
+#define digitp(p)   (*(p) >= '0' && *(p) <= '9')
 #define hexdigitp(a) (digitp (a)                     \
-                      || ((a) >= 'A' && (a) <= 'F')  \
-                      || ((a) >= 'a' && (a) <= 'f'))
+                      || (*(a) >= 'A' && *(a) <= 'F')  \
+                      || (*(a) >= 'a' && *(a) <= 'f'))
 #define ascii_isspace(a) ((a)==' ' || (a)=='\n' || (a)=='\r' || (a)=='\t')
 #define xtoi_1(p)   ((p) <= '9'? ((p)- '0'): \
                      (p) <= 'F'? ((p)-'A'+10):((p)-'a'+10))
@@ -172,7 +175,7 @@ print_pr_data (const unsigned char *data, size_t datalen, size_t off)
         {
           if (needlf)
             putchar ('\n');
-          printf ("  [%04d] ", off);
+          printf ("  [%04lu] ", (unsigned long)off);
         }
       printf (" %02X", data[off]);
       needlf = 1;
@@ -608,14 +611,14 @@ collect_data (char *hexdata, const char *address, unsigned int lineno)
     {
       if (ascii_isspace (*s))
         continue;
-      if (!hexdigitp (*s))
+      if (!hexdigitp (s))
         {
           err ("invalid hex digit in line %u - line skipped", lineno);
           break;
         }
       value = xtoi_1 (*s) * 16;
       s++;
-      if (!hexdigitp (*s))
+      if (!hexdigitp (s))
         {
           err ("invalid hex digit in line %u - line skipped", lineno);
           break;
@@ -712,8 +715,8 @@ parse_line_sniffusb (char *line, unsigned int lineno)
   if (!p)
     return;
 
-  if (hexdigitp (p[0]) && hexdigitp (p[1])
-      && hexdigitp (p[2]) && hexdigitp (p[3])
+  if (hexdigitp (p+0) && hexdigitp (p+1)
+      && hexdigitp (p+2) && hexdigitp (p+3)
       && p[4] == ':' && !p[5])
     {
       size_t length;
@@ -722,7 +725,7 @@ parse_line_sniffusb (char *line, unsigned int lineno)
       length = databuffer.count;
       while ((p=strtok (NULL, " \t")))
         {
-          if (!hexdigitp (p[0]) || !hexdigitp (p[1]))
+          if (!hexdigitp (p+0) || !hexdigitp (p+1))
             {
               err ("invalid hex digit in line %u (%s)", lineno,p);
               break;
@@ -810,7 +813,7 @@ main (int argc, char **argv)
         }
       else if (!strcmp (*argv, "--version"))
         {
-          fputs (PGM " ("GNUPG_NAME") " PACKAGE_VERSION "\n", stdout);
+          fputs (PGM " (" GNUPG_NAME ") " PACKAGE_VERSION "\n", stdout);
           exit (0);
         }
       else if (!strcmp (*argv, "--help"))

-----------------------------------------------------------------------

Summary of changes:
 tools/ccidmon.c | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)


hooks/post-receive
-- 
The GNU Privacy Guard
http://git.gnupg.org




More information about the Gnupg-commits mailing list