<html><head></head><body>If my memory isn't playing tricks on me, I recall getting a crash printing null on android.<br>
<br><br><div class="gmail_quote">On October 23, 2014 7:06:16 PM PDT, Jean-Baptiste Kempf <jb@videolan.org> wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">Hello,<br /><br />On what platform does this crash?<br /><br />Because printf of NULL usually displays (null) on most platfomrs.<br /><br />On 24 Oct, Andrew Clayton wrote :<br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> In DVDOpen() one of the first things that is done is<br /> <br /> path = strdup(ppath);<br /> <br /> path is then checked for NULL, if it is we jump to DVDOpen_error; where<br /> the first thing done is to print en error message using path. This bit<br /> of code is used as a general fall back so we don't want to stop<br /> displaying path in the cases where it isn't NULL.<br /> <br /> The simplest solution is to simply put a guard on it in the fprintf<br /> statement, in the case that path is NULL use "" instead of path.<br /> <br /> Signed-off-by: Andrew Clayton <andrew@digital-domain.net><br /> ---<br /> src/dvd_reader.c | 2 +-<br /> 1 file changed, 1
insertion(+), 1 deletion(-)<br /> <br /> diff --git a/src/dvd_reader.c b/src/dvd_reader.c<br /> index fb045b3..80b567d 100644<br /> --- a/src/dvd_reader.c<br /> +++ b/src/dvd_reader.c<br /> @@ -603,7 +603,7 @@ dvd_reader_t *DVDOpen( const char *ppath )<br /> <br /> DVDOpen_error:<br /> /* If it's none of the above, screw it. */<br /> - fprintf( stderr, "libdvdread: Could not open %s\n", path );<br /> + fprintf( stderr, "libdvdread: Could not open %s\n", (path) ? path : "");<br /> free( path );<br /> free( path_copy );<br /> if ( cdir >= 0 )<br /> -- <br /> 1.9.3<br /> <br /><hr /><br /> libdvdnav-devel mailing list<br /> libdvdnav-devel@videolan.org<br /> <a href="https://mailman.videolan.org/listinfo/libdvdnav-devel">https://mailman.videolan.org/listinfo/libdvdnav-devel</a><br /></blockquote></pre></blockquote></div><br>
-- <br>
Sent from my Android device with K-9 Mail. Please excuse my brevity.</body></html>