[MPlayer-dev-eng] [PATCH] silence a warning in stream_dvd.c

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sat Jul 31 18:59:25 CEST 2010


On Sat, Jul 31, 2010 at 06:53:20PM +0200, Diego Biurrun wrote:
> This patch casts a strtol argument to silence the warning:
> 
> stream/stream_dvd.c:98: warning: passing argument 2 of 'strtol' from incompatible pointer type
> 
> Nico wants me to send a patch first - any objections or better
> suggestions?

Not sure about better, it is a bit far on the obfuscation side, but
below is possible:
Index: stream/stream_dvd.c
===================================================================
--- stream/stream_dvd.c (revision 31876)
+++ stream/stream_dvd.c (working copy)
@@ -93,7 +93,9 @@
   dvd_chapter = 1;
   dvd_last_chapter = 0;
   if(*range && isdigit(*range)) {
-    dvd_chapter = strtol(range, &s, 10);
+    char *end;
+    dvd_chapter = strtol(range, &end, 10);
+    s += end - s;
     if(range == s) {
       mp_msg(MSGT_OPEN, MSGL_ERR, MSGTR_DVDinvalidChapterRange, range);
       return M_OPT_INVALID;



More information about the MPlayer-dev-eng mailing list