On 01.03.2018 13:59, Cornelia Huck wrote: > On Thu, 1 Mar 2018 10:47:42 +0100 > Marc-André Lureau <[email protected]> wrote: > >> Hi >> >> On Thu, Mar 1, 2018 at 8:08 AM, Julia Suvorova via Qemu-devel >> <[email protected]> wrote: >>> basename(3) and dirname(3) modify their argument and may return >>> pointers to statically allocated memory which may be overwritten by >>> subsequent calls. >>> g_path_get_basename and g_path_get_dirname have no such issues, and >>> therefore more preferable. >>> >>> Signed-off-by: Julia Suvorova <[email protected]> >> >> What about adding a warning for basename()/dirname() usage in >> scripts/checkpatch.pl ? > > +1 to that. >
Ok. I'll prepare a separate patch for that. Thanks for the review. >> >> Reviewed-by: Marc-André Lureau <[email protected]> > > Reviewed-by: Cornelia Huck <[email protected]> >
