From 0b04554772fff4ad7f5f4876bd209ef4103c2ce9 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Tue, 16 Oct 2007 02:19:40 +0000 Subject: [PATCH] maybe fix crash reported by Lacrocivious in http://pastebin.ca/738142 --- libtransmission/fastresume.c | 2 +- libtransmission/metainfo.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libtransmission/fastresume.c b/libtransmission/fastresume.c index 80aeb49a1..f4a351ee7 100644 --- a/libtransmission/fastresume.c +++ b/libtransmission/fastresume.c @@ -189,7 +189,7 @@ tr_fastResumeSave( const tr_torrent * tor ) uint64_t total; fastResumeFileName( path, sizeof path, tor, 1 ); - file = fopen( path, "wb" ); + file = fopen( path, "wb+" ); if( NULL == file ) { tr_err( "Couldn't open '%s' for writing", path ); return; diff --git a/libtransmission/metainfo.c b/libtransmission/metainfo.c index b4c43ab79..c2f70c04c 100644 --- a/libtransmission/metainfo.c +++ b/libtransmission/metainfo.c @@ -621,7 +621,7 @@ savetorrent( const char * hash, const char * tag, FILE * file; savedname( path, sizeof path, hash, tag ); - file = fopen( path, "wb" ); + file = fopen( path, "wb+" ); if( !file ) { tr_err( "Could not open file (%s) (%s)", path, strerror( errno ) );