Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Manish Goregaokar <manish@mozilla.com>
To: gdb-patches@sourceware.org, Pedro Alves <palves@redhat.com>
Subject: [PATCH] Initialize strtok_r's saveptr to NULL
Date: Wed, 29 Jun 2016 12:45:00 -0000	[thread overview]
Message-ID: <CAFOnWknprKQpWy3TU1x7cZZ7n+=nJyw7nhHme9KtLxiv8GasbQ@mail.gmail.com> (raw)

Accidentally sent this directly to palves instead of to the list.


In the review of the previous patch it was mentioned that we shouldn't
need to initialize this,
but it seems like elsewhere in the codebase we initialize the saveptr
of strtok_r to NULL too.


----

This fixes a build warning.

2016-06-29  Manish Goregaokar  <manish@mozilla.com>

gdb/ChangeLog:
    * rust-lang.c (rust_get_disr_info): Initialize saveptr to NULL
---
 gdb/rust-lang.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c
index c01687a..1849349 100644
--- a/gdb/rust-lang.c
+++ b/gdb/rust-lang.c
@@ -121,7 +121,7 @@ rust_get_disr_info (struct type *type, const
gdb_byte *valaddr,
   if (strncmp (TYPE_FIELD_NAME (type, 0), RUST_ENUM_PREFIX,
            strlen (RUST_ENUM_PREFIX)) == 0)
     {
-      char *tail, *token, *name, *saveptr;
+      char *tail, *token, *name, *saveptr = NULL;
       unsigned long fieldno;
       struct type *member_type;
       LONGEST value;
-- 
2.8.3


             reply	other threads:[~2016-06-29 12:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-29 12:45 Manish Goregaokar [this message]
2016-06-29 14:25 ` Pedro Alves
2016-06-29 14:42   ` Manish Goregaokar
2016-06-29 15:12     ` Pedro Alves
2016-06-29 15:30       ` Manish Goregaokar
2016-06-29 15:55   ` Pedro Alves

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='CAFOnWknprKQpWy3TU1x7cZZ7n+=nJyw7nhHme9KtLxiv8GasbQ@mail.gmail.com' \
    --to=manish@mozilla.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.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