From 88086dbd9002123be39d00c53460f1ec9f2b719a Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sun, 25 Jun 2006 19:23:27 +0200 Subject: Added versioning information to the XML-file (convenient for later format changes), got rid of confusing "Password successfully changed" message when the user uses the identify-command and protected rc4_decode() against short inputs. --- storage_xml.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'storage_xml.c') diff --git a/storage_xml.c b/storage_xml.c index 35d74935..0bbcd99a 100644 --- a/storage_xml.c +++ b/storage_xml.c @@ -39,6 +39,7 @@ typedef enum /* This isn't very clean, probably making a separate error class + code for BitlBee would be a better solution. But this will work for now... */ #define XML_PASS_ERRORMSG "Wrong username or password" +#define XML_FORMAT_VERSION 1 struct xml_parsedata { @@ -409,7 +410,7 @@ static storage_status_t xml_save( irc_t *irc, int overwrite ) /* Save the hash in base64-encoded form. */ pass_buf = base64_encode( (char*) pass_md5, 21 ); - if( !xml_printf( fd, "\n", irc->nick, pass_buf ) ) + if( !xml_printf( fd, "\n", irc->nick, pass_buf, XML_FORMAT_VERSION ) ) goto write_error; g_free( pass_buf ); -- cgit v1.2.3