From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8166 invoked by alias); 25 Oct 2010 12:08:17 -0000 Received: (qmail 8148 invoked by uid 9737); 25 Oct 2010 12:08:16 -0000 Date: Mon, 25 Oct 2010 12:08:00 -0000 Message-ID: <20101025120816.8146.qmail@sourceware.org> From: zkabelac@sourceware.org To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org Subject: LVM2/tools toollib.c Mailing-List: contact lvm2-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: lvm2-cvs-owner@sourceware.org X-SW-Source: 2010-10/txt/msg00068.txt.bz2 CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: zkabelac@sourceware.org 2010-10-25 12:08:16 Modified files: tools : toollib.c Log message: Reuse result of previous strchr Reported by clang as: Argument with 'nonnull' attribute passed null Reuse the result of the last strchr() call - make sure, 'st' point is not null for the next strchr() call. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/toollib.c.diff?cvsroot=lvm2&r1=1.209&r2=1.210 --- LVM2/tools/toollib.c 2010/09/23 12:02:34 1.209 +++ LVM2/tools/toollib.c 2010/10/25 12:08:15 1.210 @@ -869,7 +869,7 @@ while (*st == '/') st++; - if (!strchr(vg_name, '/') || strchr(st, '/')) { + if (!st || strchr(st, '/')) { log_error("\"%s\": Invalid path for Logical Volume", lv_name); return 0;