This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: [PATCH] Fix readlink calls in GDB
- From: "Pierre Muller" <pierre dot muller at ics-cnrs dot unistra dot fr>
- To: "'Pedro Alves'" <palves at redhat dot com>, <gdb-patches at sourceware dot org>
- Cc: <rustyBSD at gmx dot fr>
- Date: Mon, 26 Nov 2012 15:42:54 +0100
- Subject: RE: [PATCH] Fix readlink calls in GDB
- References: <20121126142036.10142.97678.stgit@brno.lan>
> -----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