From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751757AbcGOQNh (ORCPT ); Fri, 15 Jul 2016 12:13:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49227 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751638AbcGOQNa (ORCPT ); Fri, 15 Jul 2016 12:13:30 -0400 Date: Fri, 15 Jul 2016 18:13:10 +0200 From: Jiri Olsa To: Steven Rostedt Cc: Jiri Pirko , Jiri Olsa , Arnaldo Carvalho de Melo , lkml , David Ahern , Ingo Molnar , Namhyung Kim , Peter Zijlstra Subject: Re: [PATCH 1/3] perf script python: Fix string vs byte array resolving Message-ID: <20160715161310.GA831@krava> References: <1468567797-27564-1-git-send-email-jolsa@kernel.org> <1468567797-27564-2-git-send-email-jolsa@kernel.org> <20160715155110.GF1983@nanopsycho.orion> <20160715120231.4539632f@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160715120231.4539632f@gandalf.local.home> User-Agent: Mutt/1.6.2 (2016-07-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 15 Jul 2016 16:13:29 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 15, 2016 at 12:02:31PM -0400, Steven Rostedt wrote: SNIP > > for "AA\1\0" this returns "1" although that should return "0". > > > > orig len 4 > > decremented len 3 > > for: > > 0 1 > > > > index 2 would not be inspected. Or am I missing something? > > > > I think that the for check should be "i < len" > > Yes it should be. I think we got the two solutions mixed up. > > With the above len--, it should be i < len, but when we did the check > for zero at the end, we needed the i < len - 1 ugh right.. should be 'i < len' check in the for loop, there's also the patch 2/3 that needs to be changed Arnaldo, please let me know if you need me to resend this. thanks, jirka