diff options
author | pl <pl@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-12-25 16:41:06 +0000 |
---|---|---|
committer | pl <pl@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-12-25 16:41:06 +0000 |
commit | 41e2ff053f87d8ce65e48adad5051cb1f29b2fa4 (patch) | |
tree | f5e3a82ba7d9bd6f36e95266c494d94d13fcff89 /subreader.c | |
parent | 362474485ee85128d70548a3250d61ee0950dfee (diff) | |
download | mpv-41e2ff053f87d8ce65e48adad5051cb1f29b2fa4.tar.bz2 mpv-41e2ff053f87d8ce65e48adad5051cb1f29b2fa4.tar.xz |
fix a warning (ambiguous 'if else')
fix a would be bug (separator)
small warning fixes
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3736 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'subreader.c')
-rw-r--r-- | subreader.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/subreader.c b/subreader.c index 67d72f83d9..612540e8c9 100644 --- a/subreader.c +++ b/subreader.c @@ -123,9 +123,13 @@ subtitle *sub_read_line_sami(FILE *fd, subtitle *current) { } /* 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 @@ subtitle *sub_read_line_vplayer(FILE *fd,subtitle *current) { 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 @@ subtitle *sub_read_line_ssa(FILE *fd,subtitle *current) { 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 @@ subtitle *sub_read_line_mpsub(FILE *fd, subtitle *current) { else return NULL; } } + return NULL; // we should have returned before if it's OK } subtitle *previous_aqt_sub = NULL; |