diff options
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/Display.c')
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Display.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.c b/nx-X11/programs/Xserver/hw/nxagent/Display.c index 4930baee2..5943e538e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Display.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Display.c @@ -1150,9 +1150,9 @@ void nxagentOpenDisplay(int argc, char *argv[]) if (*nxagentDisplayName == '\0') { - strncpy(nxagentDisplayName, XDisplayName(NULL), 1023); + strncpy(nxagentDisplayName, XDisplayName(NULL), sizeof(nxagentDisplayName) - 1); - nxagentDisplayName[1023] = '\0'; + nxagentDisplayName[sizeof(nxagentDisplayName) - 1] = '\0'; } nxagentCloseDisplay(); @@ -1862,7 +1862,7 @@ static FILE *nxagentLookForIconFile(char *iconName, const char *permission, singlePath[strlen(singlePath)- 1] = 0; } - if (strlen(singlePath) + strlen(iconName) + 1 < PATH_MAX) + if (strlen(singlePath) + strlen(iconName) + 1 < sizeof(singlePath)<) { strncat(singlePath, slash, 1); strcat(singlePath, iconName); |