Skip to content

Commit e822b8f

Browse files
committed
parisc: led: Use scnprintf() to avoid string truncation warning
We intentionally truncate the string and store only up to 20 characters since the LCD display does not provide more chars. For that use scnprintf() instead of snprintf() to avoid the warning. Signed-off-by: Helge Deller <deller@gmx.de>
1 parent 559eda6 commit e822b8f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/parisc/led.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ static unsigned char led_type; /* bitmask of LED_HAS_XXX */
3939
static unsigned char lastleds; /* LED state from most recent update */
4040
static unsigned char lcd_new_text;
4141
static unsigned char lcd_text[20];
42-
static unsigned char lcd_text_default[20];
4342
static unsigned char lcd_no_led_support; /* KittyHawk doesn't support LED on its LCD */
4443

4544
struct lcd_block {
@@ -456,9 +455,8 @@ static int __init early_led_init(void)
456455
struct pdc_chassis_info chassis_info;
457456
int ret;
458457

459-
snprintf(lcd_text_default, sizeof(lcd_text_default),
458+
scnprintf(lcd_text, sizeof(lcd_text),
460459
"Linux %s", init_utsname()->release);
461-
strcpy(lcd_text, lcd_text_default);
462460
lcd_new_text = 1;
463461

464462
/* Work around the buggy PDC of KittyHawk-machines */

0 commit comments

Comments
 (0)