diff options
author | Ulrich Sibiller <uli42@gmx.de> | 2019-12-29 13:15:30 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2020-01-05 23:31:20 +0100 |
commit | 03544b3ab661d3e26a806879be38331ff42e0030 (patch) | |
tree | c15290b79db0c2e27c8a22a077b386fad7f6c23d /nx-X11/programs/Xserver/hw/nxagent/Args.c | |
parent | 2a4af0c74c7a167477d57dd1d065782516313c9b (diff) | |
download | nx-libs-03544b3ab661d3e26a806879be38331ff42e0030.tar.gz nx-libs-03544b3ab661d3e26a806879be38331ff42e0030.tar.bz2 nx-libs-03544b3ab661d3e26a806879be38331ff42e0030.zip |
Error.c: make nxagentClientsLogName a pointer
no more hardcoded string length
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/Args.c')
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Args.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c index 339c6d85b..0336be822 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c @@ -1296,7 +1296,17 @@ static void nxagentParseSingleOption(char *name, char *value) } else if (strcmp(name, "clients") == 0) { - snprintf(nxagentClientsLogName, NXAGENTCLIENTSLOGNAMELENGTH, "%s", value); + char *new = strdup(value); + if (new) + { + SAFE_free(nxagentClientsLogName); + nxagentClientsLogName = new; + } + else + { + fprintf(stderr, "Warning: Ignoring option [%s] because of memory problems\n", + validateString(name)); + } return; } else if (strcmp(name, "client") == 0) |