summaryrefslogtreecommitdiffstats
path: root/drivers/auxdisplay
diff options
context:
space:
mode:
authorRobert Abel <rabel@robertabel.eu>2018-02-10 00:50:11 +0100
committerMiguel Ojeda <miguel.ojeda.sandonis@gmail.com>2018-04-12 19:02:43 +0200
commit8c483758afe4f1dc34cb8319f36302aa31776ac9 (patch)
tree9b1b2973140532669582b2f51b4898790012d104 /drivers/auxdisplay
parent54bc937f0cc2a7b9cb9802b9992f936259d015a1 (diff)
downloadlinux-8c483758afe4f1dc34cb8319f36302aa31776ac9.tar.gz
linux-8c483758afe4f1dc34cb8319f36302aa31776ac9.tar.bz2
linux-8c483758afe4f1dc34cb8319f36302aa31776ac9.zip
auxdisplay: charlcd: use null character instead of zero literal to terminate strings
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 <rabel@robertabel.eu> Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Diffstat (limited to 'drivers/auxdisplay')
-rw-r--r--drivers/auxdisplay/charlcd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/auxdisplay/charlcd.c b/drivers/auxdisplay/charlcd.c
index 45ec5ce697c4..b61cea36add5 100644
--- a/drivers/auxdisplay/charlcd.c
+++ b/drivers/auxdisplay/charlcd.c
@@ -528,7 +528,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;
@@ -537,7 +537,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 */