From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27569 invoked by alias); 29 Jun 2016 12:45:40 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 27523 invoked by uid 89); 29 Jun 2016 12:45:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=palves X-HELO: mail-wm0-f44.google.com Received: from mail-wm0-f44.google.com (HELO mail-wm0-f44.google.com) (74.125.82.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 29 Jun 2016 12:45:20 +0000 Received: by mail-wm0-f44.google.com with SMTP id v199so179381137wmv.0 for ; Wed, 29 Jun 2016 05:45:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=RxxN+iXndbZkPNvEMuSH4E3bglG+uTvVM4V/xPiaDRc=; b=fhaNpUbwxrHz9igHxPS1lygyiTxdfPwhOd7VCoezgrqlEFqCrKTWEeLaHSptd+lvq+ K8VAjWy+cDS0fkRRmWp/Kb4Th/mYr0VwLarUj1+Ag6+go0wDK9xlF6/zndOgt8jpUNkh AOkK5BP/esQVssQz82CjzKkEjulpf9v8C69SYJM1Fg1u1JA2gcC4giME653Bgj/JEy/d //R6SzzjXdblIJL4FP8WxrqpteGhgcaytzYHp2jZOnT044t1dvHxCs80tTY4uZjBITwy MU4gPJuFsBU8B9TuRsbq4xV/ioNchzgz9FfO+Dr7HPDNxCn+PtfKnQ4wWL+/Tvs95c9q jhBg== X-Gm-Message-State: ALyK8tIr1wJJU/gXsYO9T4TbpZki8waVTK69csVqjJm28TN23n/7H1aC2GXISrOuUVrzOk3VwJ7qGyTnMREGnfSA X-Received: by 10.194.200.164 with SMTP id jt4mr8482301wjc.18.1467204317041; Wed, 29 Jun 2016 05:45:17 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.36.215 with HTTP; Wed, 29 Jun 2016 05:45:16 -0700 (PDT) From: Manish Goregaokar Date: Wed, 29 Jun 2016 12:45:00 -0000 Message-ID: Subject: [PATCH] Initialize strtok_r's saveptr to NULL To: gdb-patches@sourceware.org, Pedro Alves Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2016-06/txt/msg00507.txt.bz2 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 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