Received: by 10.223.176.5 with SMTP id f5csp1262522wra; Fri, 9 Feb 2018 16:00:23 -0800 (PST) X-Google-Smtp-Source: AH8x225hvcnqMx6BbhToyxDOBX+P6CFFwPfJy3bYLZXMeg4yMwcP44j3QoXDztT1HCf/C+VOpwog X-Received: by 10.99.172.2 with SMTP id v2mr3736201pge.204.1518220823241; Fri, 09 Feb 2018 16:00:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518220823; cv=none; d=google.com; s=arc-20160816; b=yeWq+qzIw90vj9uKfuHxTuSnzAVBgmmgwpwAhweAQ+ylg9YK2ZF5GhqEym2aF8nTI2 FgnOOVfk5jDlK0/lSGFxMsIm2+fdcc/fe4lCal1feoZGCY4ZQVPm9HCfuMtpjPR5DLId SXP40ceUWnhhLj5agKs8MDEuEO1kNeaKWoJcHDCwQJCDO+0Kfq+/q19LBbbxJsTQQdt2 l+e8bsaPRf71XTlh0dGwoC8Hv0QN9svLH2vQLb4Ps99/u7sBlZNGTnpeEnw5OAIxaoWM IlnR5c++MSScienmqFe7lUeWiQNpybLAIjH3jqZAbAdIJEESepUnWBDXpGC58RmS2wE6 q9CQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=D0+i4bMGWJ6K+BrvNCjxLDe9NwE6FrYXSDT88HIKWRI=; b=HJejvlxhKaPsmRw3/NWpcM/q46GbfvET6Z8b8BlMMPspgvXadQMlma2X7Racq0BnD5 pxDinGHGIven37YmFHo9PFpoqH3Uc36kpX2TRdraqGiUiuZMbhq9fJkIgj3iftd5buoi jbKVv60ODFfoMOM2Lb6g0nSrvE2odkPzy5azd1Ddaygo9VSIZEWY/2D8+SIuCq1aoOPS eDn5XWy1SM9PnwwxTx1IwSCCK+Ca3/PTeVVDzjZGZgW5j24mtP9xdI74R4pLz2zEU46K 9VcuXLNmtd5WV3hIG//LleJW+4OaxCyFLjlXpfsqnRhWAFbCVQdxzY10rBbuEdSkWmEu qNKw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u11-v6si2123003pls.480.2018.02.09.16.00.09; Fri, 09 Feb 2018 16:00:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753388AbeBIX6p (ORCPT + 99 others); Fri, 9 Feb 2018 18:58:45 -0500 Received: from mxf98a.netcup.net ([46.38.249.138]:57517 "EHLO mxf98a.netcup.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753329AbeBIX6n (ORCPT ); Fri, 9 Feb 2018 18:58:43 -0500 Received: from buildbert.robertabel.eu (x4d077b85.dyn.telefonica.de [77.7.123.133]) by mxf98a.netcup.net (Postfix) with ESMTPSA id 3CCB41409D6; Sat, 10 Feb 2018 00:50:40 +0100 (CET) Authentication-Results: mxf98a; spf=pass (sender IP is 77.7.123.133) smtp.mailfrom=rabel@robertabel.eu smtp.helo=buildbert.robertabel.eu Received-SPF: pass (mxf98a: connection is authenticated) From: Robert Abel To: miguel.ojeda.sandonis@gmail.com Cc: linux-kernel@vger.kernel.org, Robert Abel Subject: [PATCH 2/3] auxdisplay: charlcd: use null character instead of zero literal to terminate strings Date: Sat, 10 Feb 2018 00:50:11 +0100 Message-Id: <20180209235012.4993-3-rabel@robertabel.eu> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180209235012.4993-2-rabel@robertabel.eu> References: <20180209235012.4993-1-rabel@robertabel.eu> <20180209235012.4993-2-rabel@robertabel.eu> X-PPP-Message-ID: <20180209235040.28621.29407@mxf98a.netcup.net> X-PPP-Vhost: robertabel.eu Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Using '\0' instead of plain 0 makes the intent clearer that this is indeed a string and not a series of integers. Signed-off-by: Robert Abel --- drivers/auxdisplay/charlcd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/auxdisplay/charlcd.c b/drivers/auxdisplay/charlcd.c index 324d02f9f1c5..92549c8344a4 100644 --- a/drivers/auxdisplay/charlcd.c +++ b/drivers/auxdisplay/charlcd.c @@ -527,7 +527,7 @@ static void charlcd_write_char(struct charlcd *lcd, char c) if ((c != '\n') && priv->esc_seq.len >= 0) { /* yes, let's add this char to the buffer */ priv->esc_seq.buf[priv->esc_seq.len++] = c; - priv->esc_seq.buf[priv->esc_seq.len] = 0; + priv->esc_seq.buf[priv->esc_seq.len] = '\0'; } else { /* aborts any previous escape sequence */ priv->esc_seq.len = -1; @@ -536,7 +536,7 @@ static void charlcd_write_char(struct charlcd *lcd, char c) case LCD_ESCAPE_CHAR: /* start of an escape sequence */ priv->esc_seq.len = 0; - priv->esc_seq.buf[priv->esc_seq.len] = 0; + priv->esc_seq.buf[priv->esc_seq.len] = '\0'; break; case '\b': /* go back one char and clear it */ -- 2.11.0