[PATCH] Replace "normal printfs" with DEBUG / ERROR printf macros

Wald Commits scm-commit at wald.intevation.org
Fri Jun 20 14:31:53 CEST 2014


# HG changeset patch
# User Andre Heinecke <andre.heinecke at intevation.de>
# Date 1403267345 -7200
# Node ID f595fcbe3e762404e8ff287c4d5203c47e6b8328
# Parent  2303caf56dbb476092efec5ffacaaeb88c00daab
Replace "normal printfs" with DEBUG / ERROR printf macros

diff -r 2303caf56dbb -r f595fcbe3e76 cinst/main.c
--- a/cinst/main.c	Fri Jun 20 12:53:16 2014 +0200
+++ b/cinst/main.c	Fri Jun 20 14:29:05 2014 +0200
@@ -84,7 +84,7 @@
 
   if (*to_install || *to_remove)
     {
-      printf ("Error invalid parameters.\n");
+      ERRORPRINTF ("Error invalid parameters.\n");
       return -1;
     }
 
@@ -113,13 +113,13 @@
       size_t len = strlen (buf); /* fgets ensures buf is terminated */
       if (len <= 3)
         {
-          printf ("Line too short.\n");
+          ERRORPRINTF ("Line too short.\n");
           fclose (f);
           return ERR_INVALID_INPUT;
         }
       if (lines_read++ > MAX_LINES)
         {
-          printf ("Too many lines\n");
+          ERRORPRINTF ("Too many lines\n");
           fclose (f);
           return ERR_TOO_MUCH_INPUT;
         }
diff -r 2303caf56dbb -r f595fcbe3e76 cinst/windowsstore.c
--- a/cinst/windowsstore.c	Fri Jun 20 12:53:16 2014 +0200
+++ b/cinst/windowsstore.c	Fri Jun 20 14:29:05 2014 +0200
@@ -28,7 +28,7 @@
 
   if (ret != 0)
     {
-      printf ("decoding certificate failed\n");
+      ERRORPRINTF ("decoding certificate failed\n");
       return NULL;
     }
 
@@ -45,7 +45,7 @@
       char *error = getLastErrorMsg();
       if (error)
         {
-          printf ("Failed to create cert context: %s \n", error);
+          ERRORPRINTF ("Failed to create cert context: %s \n", error);
           free (error);
         }
       return NULL;
@@ -77,7 +77,7 @@
           char *error = getLastErrorMsg();
           if (error)
             {
-              printf ("Failed to create cert context: %s \n", error);
+              ERRORPRINTF ("Failed to create cert context: %s \n", error);
               free (error);
             }
           continue;
@@ -94,7 +94,7 @@
 
       if (pCert == NULL)
         {
-          printf ("Did not find certificate\n");
+          ERRORPRINTF ("Did not find certificate\n");
           continue;
         }
 
@@ -105,7 +105,7 @@
              pCertContext by calling the CertFreeCertificateContext
              function, even if an error is encountered. */
           char *error = getLastErrorMsg();
-          printf ("Error deleting certificate. %s", error);
+          ERRORPRINTF ("Error deleting certificate. %s", error);
           free (error);
           continue;
         }
@@ -148,7 +148,7 @@
                                                NULL);
       if (found_cert != NULL)
         {
-          printf ("Certificate already in store\n");
+          DEBUGPRINTF ("Certificate already in store\n");
           CertFreeCertificateContext (found_cert);
           CertFreeCertificateContext (pc_to_add);
           continue;
@@ -164,7 +164,7 @@
           char *error = getLastErrorMsg();
           if (error)
             {
-              printf ("Failed to add certificate: %s \n", error);
+              ERRORPRINTF ("Failed to add certificate: %s \n", error);
               free (error);
             }
         }
diff -r 2303caf56dbb -r f595fcbe3e76 common/listutil.c
--- a/common/listutil.c	Fri Jun 20 12:53:16 2014 +0200
+++ b/common/listutil.c	Fri Jun 20 14:29:05 2014 +0200
@@ -168,7 +168,7 @@
     ret = pk_parse_public_key(&pub_key_ctx, public_key_pem,
                               public_key_pem_size);
     if (ret != 0) {
-        printf("pk_parse_public_key failed with -0x%04x\n\n", -ret);
+        ERRORPRINTF ("pk_parse_public_key failed with -0x%04x\n\n", -ret);
         pk_free(&pub_key_ctx);
         return ret;
     }
@@ -177,7 +177,7 @@
                     signature, sig_size);
 
     if (ret != 0) {
-        printf("pk_verify failed with -0x%04x\n\n", -ret);
+        ERRORPRINTF ("pk_verify failed with -0x%04x\n\n", -ret);
     }
     pk_free(&pub_key_ctx);
 
@@ -249,7 +249,7 @@
 
   if (!data || !size)
     {
-      printf ("Invalid call to get_certs_to_remove \n");
+      ERRORPRINTF ("Invalid call to get_certs_to_remove \n");
       return NULL;
     }
 


More information about the Trustbridge-commits mailing list