# HG changeset patch # User eyck # Date 1009243924 0 # Node ID a2325883c46ce63bdde19cbe50841a96eaa1b212 # Parent c8a267dc99410fb1b2ed93adf803ee80ea9097aa vplayer format - no longer crashes on slightly broken subs. diff -r c8a267dc9941 -r a2325883c46c subreader.c --- a/subreader.c Tue Dec 25 01:18:59 2001 +0000 +++ b/subreader.c Tue Dec 25 01:32:04 2001 +0000 @@ -253,17 +253,17 @@ char line[LINE_LEN+1]; char line2[LINE_LEN+1]; int a1,a2,a3,b1,b2,b3; - char *p=NULL, *next; + char *p=NULL, *next,*separator; int i,len,len2,plen; memset(current, '\0', sizeof(subtitle)); while (!current->text[0]) { if (!fgets (line, LINE_LEN, fd)) return NULL; - if ((len=sscanf (line, "%d:%d:%d:%n",&a1,&a2,&a3,&plen)) < 3) + if ((len=sscanf (line, "%d:%d:%d%c%n",&a1,&a2,&a3,&separator,&plen)) < 4) continue; if (!fgets (line2, LINE_LEN, fd)) return NULL; - if ((len2=sscanf (line2, "%d:%d:%d:",&b1,&b2,&b3)) < 3) + if ((len2=sscanf (line2, "%d:%d:%d%c",&b1,&b2,&b3,&separator)) < 3) continue; // przewiń o linijkę do tyłu: fseek(fd,-strlen(line2),SEEK_CUR);