From patchwork Fri Apr 26 15:01:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 1114 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id EA38960EAB for ; Fri, 26 Apr 2019 17:02:11 +0200 (CEST) Received: from pendragon.station (net-37-182-44-227.cust.vodafonedsl.it [37.182.44.227]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 89B25337 for ; Fri, 26 Apr 2019 17:02:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1556290931; bh=tG8x2XpZGO+G4aG01WPWdtBoFK80P1WKQj4cDpkWTh0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=pPqDZALveX8SzyklIWAJcLhKIdYhqcGA+Yieeyu0vghPRVYvvWoRm7sbgWA0P8a9+ 5VjbWzwHHKPaEX2nM16GTf+6qVNPTuw6dkWWDhnUlzFy+FIN+p1UDmbVcYDplDhxgJ WHNoIckp5y+6aYbfbMOxpCJssc+E5Rpm/vbLFJww= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Fri, 26 Apr 2019 18:01:55 +0300 Message-Id: <20190426150155.18652-9-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190426150155.18652-1-laurent.pinchart@ideasonboard.com> References: <20190426150155.18652-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 8/8] cam: options: Fix string concatenation X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2019 15:02:13 -0000 Adding an integer value to a char pointer doesn't concatenate strings, it indexes in the pointed string. Fix it. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- src/cam/options.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cam/options.cpp b/src/cam/options.cpp index b80d361eaaf4..bea4a600d1d5 100644 --- a/src/cam/options.cpp +++ b/src/cam/options.cpp @@ -530,7 +530,7 @@ void OptionsParser::parseValueError(const Option &option) if (option.name) optionName = "--" + std::string(option.name); else - optionName = "-" + static_cast(option.opt); + optionName = "-" + std::string(1, option.opt); std::cerr << "Can't parse " << option.typeName() << " argument for option " << optionName << std::endl;