Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mark Kettenis <mark.kettenis@xs4all.nl>
To: woodzltc@cn.ibm.com
Cc: gdb-patches@sourceware.org
Subject: Re: [commit] Use xsnprint for xxx_pid_to_str()
Date: Tue, 19 Jul 2005 17:20:00 -0000	[thread overview]
Message-ID: <200507191719.j6JHJuHi007535@elgar.sibelius.xs4all.nl> (raw)
In-Reply-To: <Pine.LNX.4.63.0507192055310.13130@wks190384wss.cn.ibm.com> (message from Wu Zhou on Tue, 19 Jul 2005 20:57:22 +0800 (CST))

   Date: Tue, 19 Jul 2005 20:57:22 +0800 (CST)
   From: Wu Zhou <woodzltc@cn.ibm.com>

   On Mon, 18 Jul 2005, Mark Kettenis wrote:

   > Small simplification now that we have xsnprintf.  Please do something
   > similar to your favourite code if it doesn't use this idiom yet.

   Mark,

   Here is a similar patch to remote_pid_to_str in remote.c:

   Index: remote.c
   ===================================================================
   RCS file: /cvs/src/src/gdb/remote.c,v
   retrieving revision 1.194
   diff -c -p -r1.194 remote.c
   *** remote.c	22 Jun 2005 11:42:54 -0000	1.194
   --- remote.c	19 Jul 2005 12:53:37 -0000
   *************** static char *
   *** 5316,5325 ****
     remote_pid_to_str (ptid_t ptid)
     {
       static char buf[32];
   -   int size;

   !   size = snprintf (buf, sizeof buf, "thread %d", ptid_get_pid (ptid));
   !   gdb_assert (size < sizeof buf);
       return buf;
     }

   --- 5316,5323 ----
     remote_pid_to_str (ptid_t ptid)
     {
       static char buf[32];

   !   xsnprintf (buf, sizeof buf, "thread %d", ptid_get_pid (ptid));
       return buf;
     }


   OK to commit?  Thanks.

With a proper ChangeLog entry, yes!  Thanks,

Mark


  reply	other threads:[~2005-07-19 17:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-18 21:01 Mark Kettenis
2005-07-19 13:03 ` Wu Zhou
2005-07-19 17:20   ` Mark Kettenis [this message]
2005-07-20  3:06     ` Wu Zhou

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=200507191719.j6JHJuHi007535@elgar.sibelius.xs4all.nl \
    --to=mark.kettenis@xs4all.nl \
    --cc=gdb-patches@sourceware.org \
    --cc=woodzltc@cn.ibm.com \
    /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