From 13db7c6d4082be1eab59fe1222f222b25d954fbb Mon Sep 17 00:00:00 2001 From: erdgeist <> Date: Sun, 25 May 2003 16:37:19 +0000 Subject: Linux compatibility issues --- vchat-ui.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'vchat-ui.c') diff --git a/vchat-ui.c b/vchat-ui.c index 4eb625e..75d614d 100755 --- a/vchat-ui.c +++ b/vchat-ui.c @@ -1196,17 +1196,17 @@ initui (void) char date[16]; time_t now; struct tm now_tm; int dst, lenstr; - char *str; while( !feof( vchat_logfile)) { if( (fread( date, 14, 1, vchat_logfile) == 1) && (strptime( date, "%Y%m%d%H%M%S", &now_tm)) && - (((dst = fgetc( vchat_logfile )) == '0') || (dst == '1')) && - (str = fgetln(vchat_logfile, &lenstr))&& - (str[lenstr-1] == '\n')) + (((dst = fgetc( vchat_logfile )) == '0') || (dst == '1'))) { - str[lenstr-1] = 0; - now = mktime( &now_tm ); - sb_add( dst == '0' ? sb_pub : sb_priv, str, now); + if(fgets(tmpstr, TMPSTRSIZE, vchat_logfile)) { + lenstr = strlen( tmpstr ); + tmpstr[lenstr-1] = '\0'; + now = mktime( &now_tm ); + sb_add( dst == '0' ? sb_pub : sb_priv, tmpstr, now); + } } else { fseek( vchat_logfile, 0, SEEK_END); fgetc( vchat_logfile ); -- cgit v1.2.3