From patchwork Mon Jun 20 22:58:24 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 2105 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id B4EDE23F4D for ; Mon, 20 Jun 2011 22:59:01 +0000 (UTC) Received: from mail-vx0-f180.google.com (mail-vx0-f180.google.com [209.85.220.180]) by fiordland.canonical.com (Postfix) with ESMTP id 86184A1805E for ; Mon, 20 Jun 2011 22:59:01 +0000 (UTC) Received: by mail-vx0-f180.google.com with SMTP id 7so2987210vxd.11 for ; Mon, 20 Jun 2011 15:59:01 -0700 (PDT) Received: by 10.52.162.72 with SMTP id xy8mr273200vdb.87.1308610741322; Mon, 20 Jun 2011 15:59:01 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.52.183.130 with SMTP id em2cs32819vdc; Mon, 20 Jun 2011 15:59:01 -0700 (PDT) Received: by 10.216.134.67 with SMTP id r45mr5536026wei.44.1308610738189; Mon, 20 Jun 2011 15:58:58 -0700 (PDT) Received: from smtp.smtpout.orange.fr (smtp03.smtpout.orange.fr [80.12.242.125]) by mx.google.com with ESMTP id e25si13980106wes.137.2011.06.20.15.58.57; Mon, 20 Jun 2011 15:58:58 -0700 (PDT) Received-SPF: neutral (google.com: 80.12.242.125 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=80.12.242.125; Authentication-Results: mx.google.com; spf=neutral (google.com: 80.12.242.125 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) smtp.mail=daniel.lezcano@linaro.org Received: from monster.dhcp.lxc ([92.134.95.191]) by mwinf5d06 with ME id yNyp1g00347kPVY03NyxDX; Tue, 21 Jun 2011 00:58:57 +0200 From: Daniel Lezcano To: linaro-dev@lists.linaro.org Subject: [powerdebug 16/17] tree should not return a result when we pass an empty string Date: Tue, 21 Jun 2011 00:58:24 +0200 Message-Id: <1308610705-23281-16-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1308610705-23281-1-git-send-email-daniel.lezcano@linaro.org> References: <1308610705-23281-1-git-send-email-daniel.lezcano@linaro.org> Signed-off-by: Daniel Lezcano --- tree.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/tree.c b/tree.c index f95610a..aefe0fe 100644 --- a/tree.c +++ b/tree.c @@ -304,6 +304,9 @@ static int tree_finds_cb(struct tree *tree, void *data) { struct struct_find *sf = data; + if (!strlen(sf->name)) + return 0; + if (strncmp(sf->name, tree->name, strlen(sf->name))) return 0;