aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2017-12-08 00:30:32 +0100
committerUlrich Sibiller <uli42@gmx.de>2018-01-07 01:27:07 +0100
commit9a6b90c316e6ad2a5180ee9be4b0c9c7139d86b7 (patch)
treecdb783c04af593a876c866f6a1a27c3593f0d486 /nx-X11/programs
parent677da7fd30f3bd8d2fc074f5d5d4916f53bac736 (diff)
downloadnx-libs-9a6b90c316e6ad2a5180ee9be4b0c9c7139d86b7.tar.gz
nx-libs-9a6b90c316e6ad2a5180ee9be4b0c9c7139d86b7.tar.bz2
nx-libs-9a6b90c316e6ad2a5180ee9be4b0c9c7139d86b7.zip
Font.c: make nxagentGetFontServerPath more readable
Diffstat (limited to 'nx-X11/programs')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Font.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Font.c b/nx-X11/programs/Xserver/hw/nxagent/Font.c
index 0a9f6e3c3..39c3b31e1 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Font.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Font.c
@@ -1411,11 +1411,12 @@ static Bool nxagentGetFontServerPath(char * fontServerPath)
if (NXGetFontParameters(nxagentDisplay, sizeof(path), path) == True)
{
- if (*path != '\0')
- {
- strncpy(fontServerPath, path + 1, *path);
+ unsigned int len = *path;
- fontServerPath[*path] = '\0';
+ if (len)
+ {
+ strncpy(fontServerPath, path + 1, len);
+ fontServerPath[len] = '\0';
#ifdef TEST
fprintf(stderr, "nxagentGetFontServerPath: Got path [%s].\n",