Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Initialize strtok_r's saveptr to NULL
@ 2016-06-29 12:45 Manish Goregaokar
  2016-06-29 14:25 ` Pedro Alves
  0 siblings, 1 reply; 6+ messages in thread
From: Manish Goregaokar @ 2016-06-29 12:45 UTC (permalink / raw)
  To: gdb-patches, Pedro Alves

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-06-29 15:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-29 12:45 [PATCH] Initialize strtok_r's saveptr to NULL Manish Goregaokar
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox