Removed superfluous strcpy in keymap assignment code.

This commit is contained in:
robijn
2004-01-08 16:30:07 +00:00
parent a7579906f6
commit 09b7c9cbad
3 changed files with 1 additions and 8 deletions
+1 -4
View File
@@ -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; x<MaxKeyMap; x++ )
@@ -623,8 +622,6 @@ int CwLnx_init(Driver * drvthis, char *args)
/* Was a key specified in the config file ? */
if( s ) {
p->KeyMap[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 );
}
-2
View File
@@ -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 );
}
}
-2
View File
@@ -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 );
}
}