Skip to content

Commit 8c48375

Browse files
Tauwasserojeda
authored andcommitted
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 <[email protected]> Signed-off-by: Miguel Ojeda <[email protected]>
1 parent 54bc937 commit 8c48375

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/auxdisplay/charlcd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ static void charlcd_write_char(struct charlcd *lcd, char c)
528528
if ((c != '\n') && priv->esc_seq.len >= 0) {
529529
/* yes, let's add this char to the buffer */
530530
priv->esc_seq.buf[priv->esc_seq.len++] = c;
531-
priv->esc_seq.buf[priv->esc_seq.len] = 0;
531+
priv->esc_seq.buf[priv->esc_seq.len] = '\0';
532532
} else {
533533
/* aborts any previous escape sequence */
534534
priv->esc_seq.len = -1;
@@ -537,7 +537,7 @@ static void charlcd_write_char(struct charlcd *lcd, char c)
537537
case LCD_ESCAPE_CHAR:
538538
/* start of an escape sequence */
539539
priv->esc_seq.len = 0;
540-
priv->esc_seq.buf[priv->esc_seq.len] = 0;
540+
priv->esc_seq.buf[priv->esc_seq.len] = '\0';
541541
break;
542542
case '\b':
543543
/* go back one char and clear it */

0 commit comments

Comments
 (0)