git-svn: trunk@1489

Nigel Horne authored on 2005/04/23 19:33:44
Showing 1 changed files
... ...
@@ -15,7 +15,7 @@
15 15
  *  along with this program; if not, write to the Free Software
16 16
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 17
  */
18
-static	char	const	rcsid[] = "$Id: blob.c,v 1.40 2005/04/04 13:52:46 nigelhorne Exp $";
18
+static	char	const	rcsid[] = "$Id: blob.c,v 1.41 2005/04/23 10:33:44 nigelhorne Exp $";
19 19
 
20 20
 #if HAVE_CONFIG_H
21 21
 #include "clamav-config.h"
... ...
@@ -431,15 +431,12 @@ fileblobSetFilename(fileblob *fb, const char *dir, const char *filename)
431 431
 
432 432
 		return;
433 433
 	}
434
-	if(fb->b.data) {
435
-		if(fwrite(fb->b.data, fb->b.len, 1, fb->fp) != 1)
436
-			cli_errmsg("fileblobSetFilename: Can't write to temporary file %s: %s\n", fullname, strerror(errno));
437
-		else
438
-			fb->isNotEmpty = 1;
439
-		free(fb->b.data);
440
-		fb->b.data = NULL;
441
-		fb->b.len = fb->b.size = 0;
442
-	}
434
+	if(fb->b.data)
435
+		if(fileblobAddData(fb, fb->b.data, fb->b.len) == 0) {
436
+			free(fb->b.data);
437
+			fb->b.data = NULL;
438
+			fb->b.len = fb->b.size = 0;
439
+		}
443 440
 }
444 441
 
445 442
 int