No need to reduce the size by one since this is done in copystring()
authorJoey Schulze <joey@infodrom.org>
Mon, 22 Nov 2004 14:34:06 +0000 (14:34 +0000)
committerJoey Schulze <joey@infodrom.org>
Mon, 22 Nov 2004 14:34:06 +0000 (14:34 +0000)
mbox.c

diff --git a/mbox.c b/mbox.c
index 63fd0a3..fb63e49 100644 (file)
--- a/mbox.c
+++ b/mbox.c
@@ -94,22 +94,21 @@ int inspect_mbox(char *path, char *prefix, off_t size)
        priority = 0;
       } else {
        if (strncasecmp(buf, "From ", 5) == 0)
-         stringcopy(from_, buf+5, sizeof(from_)-1);
+         stringcopy(from_, buf+5, sizeof(from_));
        else if (strncasecmp(buf, "From: ", 6) == 0)
-         stringcopy(from, buf+6, sizeof(from)-1);
+         stringcopy(from, buf+6, sizeof(from));
 #ifdef FROM_DETECTION
        else if (strncasecmp(buf, "To: ", 4) == 0)
-         stringcopy(to, buf+4, sizeof(to)-1);
+         stringcopy(to, buf+4, sizeof(to));
 #endif
        else if (strncasecmp(buf, "Subject: ", 9) == 0)
-         stringcopy(subject, buf+9, sizeof(subject)-1);
+         stringcopy(subject, buf+9, sizeof(subject));
        else if (strncasecmp(buf, "Priority: ", 10) == 0)
          priority = 1;
       }
     } else if (strncasecmp(buf, "From ", 5) == 0) {
       inheader = 1;
-      strncpy(from_, buf+5, sizeof(from_)-1);
-      from[sizeof(from_)-1] = '\0';
+      stringcopy(from_, buf+5, sizeof(from_));
     }
 
   }