This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [PATCH] Fix readlink calls in GDB



> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Pedro Alves
> Envoyà : lundi 26 novembre 2012 15:21
> Ã : gdb-patches@sourceware.org
> Cc : rustyBSD@gmx.fr
> Objet : [PATCH] Fix readlink calls in GDB
> 
> This is largely based on a patch Maxime sent me, to fix readlink calls
> in GDB.
> 
> Several readlink calls in gdb are wrong.  readlink doesn't append the
> terminating nul, so if we're going to need to do that, we need to pass
> 'sizeof (buf) - 1' as buffer size.

  Just a question:
your change doesn't seem to add the terminating '\0'
in all the calls concerned, is this because it concerns specific 
native files for operating systems that already append the '\0' at the end?

  Because most arguments are used a 'char *'
and thus the terminating zero is required, no?


Pierre Muller


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]