diff src/readpst.c @ 52:034641c26ab9

code cleanup
author carl
date Thu, 31 Jan 2008 08:03:30 -0800
parents fb3818370dd6
children 7d5c637aaafb
line wrap: on
line diff
--- a/src/readpst.c	Tue Jan 22 14:39:02 2008 -0800
+++ b/src/readpst.c	Thu Jan 31 08:03:30 2008 -0800
@@ -330,6 +330,7 @@
         int l=0;
         if (NULL == (fp = fopen(fname, "rb"))) {
             fprintf(stderr, "Couldn't open file %s\n", fname );
+            DEBUG_RET();
             return 1;
         }
 
@@ -339,9 +340,11 @@
 
             if (l != fwrite( buf, 1, l, stdout)) {
                 fprintf(stderr, "Couldn't output to stdout?\n");
+                DEBUG_RET();
                 return 1;
             }
         }
+        DEBUG_RET();
         return 0;
     }
 
@@ -662,8 +665,10 @@
     // my_stristr varies from strstr in that its searches are case-insensitive
     char *x=haystack, *y=needle, *z = NULL;
     DEBUG_ENT("my_stristr");
-    if (!haystack || !needle)
+    if (!haystack || !needle) {
+        DEBUG_RET();
         return NULL;
+    }
     while (*y != '\0' && *x != '\0') {
         if (tolower(*y) == tolower(*x)) {
             // move y on one
@@ -687,6 +692,7 @@
     DEBUG_ENT("check_filename");
     if (!t) {
         DEBUG_RET();
+        return;
     }
     while ((t = strpbrk(t, "/\\:"))) {
         // while there are characters in the second string that we don't want
@@ -767,6 +773,7 @@
         enc = base64_encode (current_attach->data, current_attach->size);
         if (!enc) {
             DEBUG_EMAIL(("ERROR base64_encode returned NULL. Must have failed\n"));
+            DEBUG_RET();
             return;
         }
     }