strncpy bugfix bugfix; UPDATE RECOMMENDED

This commit is contained in:
reenoo
2001-12-26 16:25:41 +00:00
parent 531ad030ea
commit c0c5bd28df
3 changed files with 20 additions and 12 deletions
+2 -2
View File
@@ -187,7 +187,7 @@ lcdm001_cursorblink (int on)
int
lcdm001_init (struct lcd_logical_driver *driver, char *args)
{
char device[256];
char device[200];
int speed=B38400;
struct termios portset;
@@ -225,7 +225,7 @@ lcdm001_init (struct lcd_logical_driver *driver, char *args)
// READ CONFIG FILE:
// which serial device should be used
strncpy(device, config_get_string ( DriverName , "Device" , 0 , "/dev/lcd"), sizeof(config_get_string ( DriverName , "Device" , 0 , "/dev/lcd")));
strncpy(device, config_get_string ( DriverName , "Device" , 0 , "/dev/lcd"), sizeof(device));
device[sizeof(device)-1]=0;
report (RPT_INFO,"LCDM001: Using device: %s", device);