From 55078f59c8e9f52f1d10bed55511e5e58ec3e53b Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sat, 25 Nov 2006 10:20:29 +0100 Subject: Forgot to pass O_CREAT to open() which can cause problems if there's a stale .xml~ file. --- storage_xml.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'storage_xml.c') diff --git a/storage_xml.c b/storage_xml.c index ba311120..00fca425 100644 --- a/storage_xml.c +++ b/storage_xml.c @@ -394,7 +394,7 @@ static storage_status_t xml_save( irc_t *irc, int overwrite ) return STORAGE_ALREADY_EXISTS; strcat( path, "~" ); - if( ( fd = open( path, O_WRONLY | O_CREAT, 0600 ) ) < 0 ) + if( ( fd = open( path, O_WRONLY | O_CREAT | O_TRUNC, 0600 ) ) < 0 ) { irc_usermsg( irc, "Error while opening configuration file." ); return STORAGE_OTHER_ERROR; -- cgit v1.2.3