[MPlayer-dev-eng] Re: [PATCH] minor tweak to title range parsing

Robert Henney robh at rut.org
Fri Apr 7 19:27:37 CEST 2006


On Fri, Apr 07, 2006 at 09:30:01AM +0300, Jan Knutar wrote:
> On Friday 07 April 2006 09:23, Robert Henney wrote:
> > this adds 3 minor changes.
> 
> Redo it with cvs diff -u please :)
> 
> -u is easier to read for and easier to apply
-------------- next part --------------
Index: main/parser-mpcmd.c
===================================================================
RCS file: /cvsroot/mplayer/main/parser-mpcmd.c,v
retrieving revision 1.24
diff -u -r1.24 parser-mpcmd.c
--- main/parser-mpcmd.c	24 Jan 2006 11:34:24 -0000	1.24
+++ main/parser-mpcmd.c	7 Apr 2006 17:25:10 -0000
@@ -61,7 +61,7 @@
 {
   int i,j,start_title=-1,end_title=-1;
   char *opt,*splitpos=NULL;
-  char entbuf[10];
+  char entbuf[11];
   int no_more_opts = 0;
   int opt_exit = 0; // flag indicating whether mplayer should exit without playing anything
   play_tree_t *last_parent, *last_entry = NULL, *root;
@@ -221,13 +221,14 @@
                    end_title=strtol(splitpos+1,NULL,10);
                }
               
-               if (dvd_range(start_title) && dvd_range(end_title) && (start_title<end_title))      
+               if (dvd_range(start_title) && dvd_range(end_title) && (start_title<=end_title))      
                {
                  for (j=start_title;j<=end_title;j++)
                  {
                   if (j!=start_title) 
                       entry=play_tree_new();
-                  snprintf(entbuf,9,"dvd://%d",j);
+		  entbuf[sizeof entbuf - 1] = '\0';
+                  snprintf(entbuf,sizeof entbuf - 1,"dvd://%d",j);
                   play_tree_add_file(entry,entbuf);
                   add_entry(&last_parent,&last_entry,entry);
 		  last_entry = entry;


More information about the MPlayer-dev-eng mailing list