changeset 40:5cb1eb928253

Clean up debug output / functions
author Andre Heinecke <aheinecke@intevation.de>
date Fri, 14 Mar 2014 09:47:42 +0000
parents ee27186fc8e6
children 7055a79abe02
files common/listutil.c
diffstat 1 files changed, 4 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/common/listutil.c	Fri Mar 14 09:05:23 2014 +0000
+++ b/common/listutil.c	Fri Mar 14 09:47:42 2014 +0000
@@ -24,11 +24,6 @@
 
 #define MAX_FILESIZE 1048576 /* 1024*1024 */
 
-void handle_errno()
-{
-    printf("Error: %s \n", strerror(errno));
-}
-
 /**
  *  @brief Read a file into memory.
  *
@@ -118,12 +113,10 @@
     /* Hash algroithm is sha256 */
     unsigned char hash[32];
 
-    printf ("size: %lu", (unsigned long) size);
-
     /* Fetch the signature from the first line od data */
     p = strchr(data, '\r');
     if (p == 0 || (unsigned int)(p - (data + 2)) != sig_b64_size) {
-        printf("Invalid data. Signature might be too long.\n");
+/*        printf("Invalid data. Signature might be too long.\n"); */
         return -1;
     }
     strncpy(signature_b64, data + 2, sig_b64_size);
@@ -133,7 +126,7 @@
                         (unsigned char *)signature_b64, sig_b64_size);
 
     if (ret != 0 || sig_size != 384) {
-        printf("failed to decode signature\n");
+/*        printf("failed to decode signature\n"); */
         return -1;
     }
 
@@ -193,6 +186,7 @@
 
     ret = read_file(file_name, data, size, MAX_FILESIZE);
 
+    /* printf ("Ret: %i \n", ret); */
     if (ret != 0) {
         if (ret == READ_FILE_TOO_LARGE) {
             return TooLarge;
@@ -207,6 +201,7 @@
     }
 
     if (!*data || !*size) {
+        /* File is probably empty */
         return UnknownError;
     }
 

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