[PATCH] minor tweak to title range parsing
this adds 3 minor changes. handling of play ranges with 3-digit title numbers is handled correctly. eg. dvd://99-100 nope, I've yet to see a dvd with that many titles, but I've seen ones that have gotten close. ranges that end on the same title they begin at are handled as would be expected and are not taken to be invalid. eg. dvd://4-4 reliance on the uninitialized state of the last byte in the string buffer removed, along with magic number.
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
On Fri, Apr 07, 2006 at 01:27:37PM -0400, Robert Henney wrote:
- snprintf(entbuf,9,"dvd://%d",j); + entbuf[sizeof entbuf - 1] = '\0'; + snprintf(entbuf,sizeof entbuf - 1,"dvd://%d",j);
This part nonsense. snprintf always null-terminates. Use: snprintf(entbuf,sizeof entbuf,"dvd://%d",j); Rich
On Fri, Apr 07, 2006 at 03:10:43PM -0400, Rich Felker wrote:
On Fri, Apr 07, 2006 at 01:27:37PM -0400, Robert Henney wrote:
- snprintf(entbuf,9,"dvd://%d",j); + entbuf[sizeof entbuf - 1] = '\0'; + snprintf(entbuf,sizeof entbuf - 1,"dvd://%d",j);
This part nonsense. snprintf always null-terminates. Use: snprintf(entbuf,sizeof entbuf,"dvd://%d",j);
right you are. I guess I wasn't being very trusting of the various implementations of the C99 (if I'm remembering the right one) standard functions. new patch attached
participants (3)
-
Jan Knutar -
Rich Felker -
Robert Henney