Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: "Pierre Muller" <pierre.muller@ics-cnrs.unistra.fr>
Subject: Re: [RFA 2/2]  Remove old Cygwin1.5 support
Date: Thu, 07 Apr 2011 23:44:00 -0000	[thread overview]
Message-ID: <201104080044.27841.pedro@codesourcery.com> (raw)
In-Reply-To: <005101cbf4ae$1dca5fc0$595f1f40$@muller@ics-cnrs.unistra.fr>

On Wednesday 06 April 2011 23:58:17, Pierre Muller wrote:
>    if (path_ptr)
>      {
> +      int len = cygwin_conv_path_list (CCP_POSIX_TO_WIN_A, path_ptr, NULL,
> 0);

Your use of `len' for the variable's name confused me into
thinking there's an off-by-one below.  The cygwin_conv_path_list function
returns a byte size including the null terminator, not a string
length.  Please rename the variable to `size'.  Okay with that change.

>        orig_path = alloca (strlen (path_ptr) + 1);
> -      new_path = alloca (cygwin_posix_to_win32_path_list_buf_size
> (path_ptr));
> +      new_path = alloca (len);
>        strcpy (orig_path, path_ptr);
> -      cygwin_posix_to_win32_path_list (path_ptr, new_path);
> +      cygwin_conv_path_list (CCP_POSIX_TO_WIN_A, path_ptr, new_path, len);
>        setenv ("PATH", new_path, 1);

-- 
Pedro Alves


  reply	other threads:[~2011-04-07 23:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-06 22:58 Pierre Muller
2011-04-07 23:44 ` Pedro Alves [this message]
2011-04-08  0:01   ` Pierre Muller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201104080044.27841.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pierre.muller@ics-cnrs.unistra.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox