This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] Initialize strtok_r's saveptr to NULL
- From: Manish Goregaokar <manish at mozilla dot com>
- To: gdb-patches at sourceware dot org, Pedro Alves <palves at redhat dot com>
- Date: Wed, 29 Jun 2016 18:15:16 +0530
- Subject: [PATCH] Initialize strtok_r's saveptr to NULL
- Authentication-results: sourceware.org; auth=none
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