Coverity fixes
[claws.git] / src / partial_download.c
index 3623027b05b3f690898211778344e57009c782df..d7b0ce695921b78c83992b9c81da238ed5144e3d 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2009 Colin Leroy <colin@colino.net> 
+ * Copyright (C) 1999-2012 Colin Leroy <colin@colino.net> 
  * and the Claws Mail team
  *
  * This program is free software; you can redistribute it and/or modify
@@ -44,6 +44,7 @@
 
 #ifdef HAVE_CONFIG_H
 #  include "config.h"
+#include "claws-features.h"
 #endif
 
 #include <glib.h>
@@ -71,7 +72,6 @@ int partial_msg_in_uidl_list(MsgInfo *msginfo)
        gchar uidl[POPBUFSIZE];
        time_t recv_time;
        time_t now;
-       gint partial_recv;
        gchar *sanitized_uid = NULL;
        
        if (!msginfo->extradata)
@@ -111,7 +111,6 @@ int partial_msg_in_uidl_list(MsgInfo *msginfo)
                gchar tmp[POPBUFSIZE];
                strretchomp(buf);
                recv_time = RECV_TIME_NONE;
-               partial_recv = POP3_TOTALLY_RECEIVED;
                
                if (sscanf(buf, "%s\t%ld\t%s", uidl, (long int *) &recv_time, 
                           tmp) < 2) {
@@ -317,8 +316,7 @@ static int partial_uidl_mark_mail(MsgInfo *msginfo, int download)
        }
 
        fclose(fp);
-       claws_unlink(filename);
-       g_rename(pathnew, filename);
+       rename_force(pathnew, filename);
        g_free(pathnew);
        msginfo->planned_download = download;
        msgcache_update_msg(msginfo->folder->cache, msginfo);
@@ -385,7 +383,6 @@ gchar *partial_get_filename(const gchar *server, const gchar *login,
        gchar uidl[POPBUFSIZE];
        time_t recv_time;
        time_t now;
-       gint partial_recv;
        gchar *sanitized_uid = g_strdup(login); 
 
        subst_for_filename(sanitized_uid);
@@ -415,7 +412,6 @@ gchar *partial_get_filename(const gchar *server, const gchar *login,
                gchar tmp[POPBUFSIZE];
                strretchomp(buf);
                recv_time = RECV_TIME_NONE;
-               partial_recv = POP3_TOTALLY_RECEIVED;
                
                if (sscanf(buf, "%s\t%ld\t%s", uidl, (long int *) &recv_time, 
                           tmp) < 2) {