Skip to content

Commit

Permalink
Args.c: drop 255 byte limit for -keyboard option
Browse files Browse the repository at this point in the history
Could not find a reason to limit that string.
  • Loading branch information
uli42 committed Nov 23, 2017
1 parent e6884ca commit a973993
Showing 1 changed file with 2 additions and 20 deletions.
22 changes: 2 additions & 20 deletions nx-X11/programs/Xserver/hw/nxagent/Args.c
Original file line number Diff line number Diff line change
Expand Up @@ -643,31 +643,13 @@ int ddxProcessArgument(int argc, char *argv[], int i)
{
if (++i < argc)
{
int size;

free(nxagentKeyboard);
nxagentKeyboard = NULL;

/* FIXME: why limit to 256? */
if ((size = strlen(argv[i])) < 256)
if ((nxagentKeyboard = strdup(argv[i])) == NULL)
{
if ((nxagentKeyboard = strndup(argv[i], size)) == NULL)
{
FatalError("malloc for -keyboard failed");
}
FatalError("malloc for -keyboard failed");
}
#ifdef WARNING
else
{
/*
* it is useless to remember a kbtype
* option that has just been truncated.
*/

fprintf(stderr, "ddxProcessArgument: WARNING! Option [%s] too long. "
"It will be ignored.\n", argv[i]);
}
#endif
return 2;
}
return 0;
Expand Down

0 comments on commit a973993

Please sign in to comment.