remove useless things
[apps/madmutt.git] / editmsg.c
index a11a5e4..f204456 100644 (file)
--- a/editmsg.c
+++ b/editmsg.c
@@ -9,22 +9,13 @@
 
 /* simple, editor-based message editing */
 
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include <lib-lib/lib-lib.h>
+#include <lib-ui/curses.h>
 
 #include "mutt.h"
 #include "copy.h"
 #include "mx.h"
 
-#include "lib/intl.h"
-#include "lib/str.h"
-
-#include <sys/stat.h>
-#include <errno.h>
-
-#include <time.h>
-
 /*
  * return value:
  * 
@@ -53,7 +44,7 @@ static int edit_one_message (CONTEXT * ctx, HEADER * cur)
 
   struct stat sb;
   time_t mtime = 0;
-  size_t size = 0;
+  ssize_t size = 0;
 
   mutt_mktemp (tmp);
 
@@ -95,7 +86,7 @@ static int edit_one_message (CONTEXT * ctx, HEADER * cur)
    * remove it, the message will grow by one line each time the user edits
    * the message.
    */
-  if (sb.st_size != 0 && truncate (tmp, sb.st_size - 1) == -1) {
+  if (size != 0 && truncate (tmp, --size) == -1) {
     mutt_error (_("could not truncate temporary mail folder: %s"),
                 strerror (errno));
     goto bail;