From 09b7c9cbadd8a76c4f3c584aa39b1fa601fd9399 Mon Sep 17 00:00:00 2001 From: robijn Date: Thu, 8 Jan 2004 16:30:07 +0000 Subject: [PATCH] Removed superfluous strcpy in keymap assignment code. --- server/drivers/CwLnx.c | 5 +---- server/drivers/hd44780.c | 2 -- server/drivers/sed1330.c | 2 -- 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/server/drivers/CwLnx.c b/server/drivers/CwLnx.c index 1bef580..bb1d020 100644 --- a/server/drivers/CwLnx.c +++ b/server/drivers/CwLnx.c @@ -502,7 +502,6 @@ int CwLnx_init(Driver * drvthis, char *args) int w; int h; char *s; - char x; PrivateData *p; @@ -602,7 +601,7 @@ int CwLnx_init(Driver * drvthis, char *args) /* read the keypad mapping only if we have a keypad. */ if (p->have_keypad) { - + int x; /* Read keymap */ for(x=0; xKeyMap[x] = strdup( s ); -/* Code from hd44780 but why a strcpy adfter a strdup ? */ -/* strcpy( p->KeyMap[x], s ); */ /* printf("CwLnx: Key '%c' to \"%s\"\n", x+'A', s ); */ report( RPT_INFO, "CwLnx: Key '%c' to \"%s\"", x+'A', s ); } diff --git a/server/drivers/hd44780.c b/server/drivers/hd44780.c index 0f3b462..59b08d6 100644 --- a/server/drivers/hd44780.c +++ b/server/drivers/hd44780.c @@ -260,7 +260,6 @@ HD44780_init (Driver * drvthis, char *args) // Was a key specified in the config file ? if( s ) { p->keyMapDirect[x] = strdup( s ); - strcpy( p->keyMapDirect[x], s ); report( RPT_INFO, "HD44780: Direct key %d: \"%s\"", x, s ); } } @@ -279,7 +278,6 @@ HD44780_init (Driver * drvthis, char *args) // Was a key specified in the config file ? if( s ) { p->keyMapMatrix[y][x] = strdup( s ); - strcpy( p->keyMapMatrix[y][x], s ); report( RPT_INFO, "HD44780: Matrix key %d %d: \"%s\"", x, y, s ); } } diff --git a/server/drivers/sed1330.c b/server/drivers/sed1330.c index 719365c..2b357c5 100644 --- a/server/drivers/sed1330.c +++ b/server/drivers/sed1330.c @@ -405,7 +405,6 @@ sed1330_init( Driver * drvthis, char *args ) // Was a key specified in the config file ? if( s ) { p->keyMapDirect[x] = strdup( s ); - strcpy( p->keyMapDirect[x], s ); report( RPT_INFO, "SED1330: Direct key %d: \"%s\"", x, s ); } } @@ -424,7 +423,6 @@ sed1330_init( Driver * drvthis, char *args ) // Was a key specified in the config file ? if( s ) { p->keyMapMatrix[y][x] = strdup( s ); - strcpy( p->keyMapMatrix[y][x], s ); report( RPT_INFO, "SED1330: Matrix key %d,%d: \"%s\"", x, y, s ); } }