Try to recover when a history log file is damaged
Mcabber used to hang when a history file contained NUL characters.
Thanks to nedko for the report.
--- a/mcabber/mcabber/histolog.c Sun Sep 29 10:24:24 2013 +0200
+++ b/mcabber/mcabber/histolog.c Sun Sep 29 10:44:42 2013 +0200
@@ -229,6 +229,12 @@
while (1) {
for (tail = data; *tail; tail++) ;
+ if (tail == data) {
+ // That would happen if the log file has NUL characters...
+ scr_LogPrint(LPRINT_LOGNORM, "Corrupted history file! Trying to recover.");
+ err = 1;
+ break;
+ }
noeol = (*(tail-1) != '\n');
if (!noeol)
break;