aboutsummaryrefslogtreecommitdiffstats
path: root/storage_xml.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2006-11-25 10:20:29 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2006-11-25 10:20:29 +0100
commit55078f59c8e9f52f1d10bed55511e5e58ec3e53b (patch)
treede5237478a8785ca0003462f6b872a9294076576 /storage_xml.c
parentdfc8a468020935a444397129eb5b2579e1001cf2 (diff)
Forgot to pass O_CREAT to open() which can cause problems if there's a
stale .xml~ file.
Diffstat (limited to 'storage_xml.c')
-rw-r--r--storage_xml.c2
1 files changed, 1 insertions, 1 deletions
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;