diff options
Diffstat (limited to 'nx-X11/programs')
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Font.c | 9 |
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", |