This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [COMMIT PATCH 1/2] savestring: Rename parameter 'size' to 'len'.
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: palves at redhat dot com
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 14 Feb 2013 19:30:01 +0100 (CET)
- Subject: Re: [COMMIT PATCH 1/2] savestring: Rename parameter 'size' to 'len'.
- References: <20130214171404.2223.83713.stgit@brno.lan>
> From: Pedro Alves <palves@redhat.com>
> Date: Thu, 14 Feb 2013 17:14:04 +0000
>
> It's better to avoid needless confusion, and call a string's length,
> length, instead of size, which is usually used to refer to sizeof of
> the string (len+1):
>
> size_t len = strlen (str);
> size_t size = sizeof (str);
>
> Tested on x86_64 Fedora 17.
Agreed
> 2013-02-14 Pedro Alves <palves@redhat.com>
>
> * utils.c (savestring): Rename parameter 'size' to 'len'.
> ---
> gdb/utils.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>