sync with 0.8.1cvs15
[claws.git] / src / utils.c
index c072f7436c133f92bf5c3c3d4a55de54d20ed4a6..a353d43874992d04433a7d5b8ccffd587f09b5ba 100644 (file)
@@ -2116,8 +2116,11 @@ gint canonicalize_file(const gchar *src, const gchar *dest)
                } else if (len > 1 && buf[len - 1] == '\n' && buf[len - 2] == '\r') {
                        r = fputs(buf, dest_fp);
                } else {
-                       if (len > 1)
+                       if (len > 1) {
                                r = fwrite(buf, len - 1, 1, dest_fp);
+                               if (r != 1)
+                                       r = EOF;
+                       }
                        if (r != EOF)
                                r = fputs("\r\n", dest_fp);
                }