From patchwork Fri Feb 8 00:45:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Chu X-Patchwork-Id: 2113861 X-Patchwork-Delegate: hal@mellanox.com Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 0DC0DDFB7B for ; Fri, 8 Feb 2013 00:54:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757307Ab3BHAyr (ORCPT ); Thu, 7 Feb 2013 19:54:47 -0500 Received: from prdiron-1.llnl.gov ([128.15.143.171]:11622 "EHLO prdiron-1.llnl.gov" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752252Ab3BHAyr (ORCPT ); Thu, 7 Feb 2013 19:54:47 -0500 X-Attachments: Received: from auk59.llnl.gov (HELO [134.9.93.24]) ([134.9.93.24]) by prdiron-1.llnl.gov with ESMTP; 07 Feb 2013 16:45:01 -0800 Subject: [PATCH 1/2] ibsim: Fix PerformanceSet parsing corner case From: Albert Chu To: linux-rdma@vger.kernel.org Date: Thu, 07 Feb 2013 16:45:01 -0800 Message-Id: <1360284301.17736.154.camel@auk59.llnl.gov> Mime-Version: 1.0 X-Mailer: Evolution 2.12.3 (2.12.3-19.el5) Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Parse of attribute did not properly remove whitespace before it. So PerformanceSet "H-0002c90300325280" PortCounters.SymbolErrorCounter=3 would work but PerformanceSet "H-0002c90300325280" PortCounters.SymbolErrorCounter=3\ would not. Signed-off-by: Albert Chu --- ibsim/sim_cmd.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/ibsim/sim_cmd.c b/ibsim/sim_cmd.c index f44df93..83ad52d 100644 --- a/ibsim/sim_cmd.c +++ b/ibsim/sim_cmd.c @@ -911,7 +911,9 @@ static int do_perf_counter_set(FILE *f, char *line) return -1; } - strsep(&s, " "); + if (s && *s) + while (isspace(*s)) + s++; attr = strsep(&s, "."); if(s == NULL) goto format_error;