changeset 626:f595fcbe3e76

Replace "normal printfs" with DEBUG / ERROR printf macros
author Andre Heinecke <andre.heinecke@intevation.de>
date Fri, 20 Jun 2014 14:29:05 +0200
parents 2303caf56dbb
children facb13c578f1
files cinst/main.c cinst/windowsstore.c common/listutil.c
diffstat 3 files changed, 13 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- 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;
         }
--- 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);
             }
         }
--- 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;
     }
 

http://wald.intevation.org/projects/trustbridge/