[MPlayer-dev-eng] [PATCH] libmenu: fill allocated memory for path variable with 0, fixes menu_keepdir

Aurelien Jacobs aurel at gnuage.org
Tue Jun 3 19:33:35 CEST 2008


Guillaume LECERF wrote:

> On Tue, Jun 3, 2008 at 2:27 PM, Guillaume LECERF <foxcore at gmail.com> wrote:
> >    freepath = path;
> >    path[st.st_size] = '\0';
> 
> Further simplifications.

No need to memset the whole path to 0. Just setting path[st.st_size] = 0
should be enough, as long as it's done before the call to stat().

Aurel



More information about the MPlayer-dev-eng mailing list