# HG changeset patch # User pl # Date 1009298466 0 # Node ID 8baf42fa69b96ba42cc9d5278d91e0a88c3b3430 # Parent e8ca83c5d013cb8dbd3cb3816d67e7ad75b1154e fix a warning (ambiguous 'if else') fix a would be bug (separator) small warning fixes diff -r e8ca83c5d013 -r 8baf42fa69b9 subreader.c --- a/subreader.c Tue Dec 25 16:39:12 2001 +0000 +++ b/subreader.c Tue Dec 25 16:41:06 2001 +0000 @@ -123,9 +123,13 @@ } /* read next line */ - if (state != 99 && !(s = fgets (line, LINE_LEN, fd))) - if (current->start > 0) break; // if it is the last subtitle - else return 0; + if (state != 99 && !(s = fgets (line, LINE_LEN, fd))) { + if (current->start > 0) { + break; // if it is the last subtitle + } else { + return 0; + } + } } while (state != 99); @@ -253,7 +257,7 @@ char line[LINE_LEN+1]; char line2[LINE_LEN+1]; int a1,a2,a3,b1,b2,b3; - char *p=NULL, *next,*separator; + char *p=NULL, *next,separator; int i,len,len2,plen; memset(current, '\0', sizeof(subtitle)); @@ -365,7 +369,7 @@ current->start = 360000*hour1 + 6000*min1 + 100*sec1 + hunsec1; current->end = 360000*hour2 + 6000*min2 + 100*sec2 + hunsec2; - while (tmp=strstr(line2, "\\n")) { + while ((tmp=strstr(line2, "\\n")) != NULL) { current->text[num]=(char *)malloc(tmp-line2+1); strncpy (current->text[num], line2, tmp-line2); current->text[num][tmp-line2]='\0'; @@ -432,6 +436,7 @@ else return NULL; } } + return NULL; // we should have returned before if it's OK } subtitle *previous_aqt_sub = NULL;