aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent/Display.c
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2017-11-23 21:25:26 +0100
committerUlrich Sibiller <uli42@gmx.de>2018-01-07 01:27:07 +0100
commit5987a7b1af09e97271be3da74d336a64435e759a (patch)
tree5ee10aefa54ee4c4c1d4e7fd16c21206b2732399 /nx-X11/programs/Xserver/hw/nxagent/Display.c
parent3c81899718e3429e45381beaaba58d4886a5537c (diff)
downloadnx-libs-5987a7b1af09e97271be3da74d336a64435e759a.tar.gz
nx-libs-5987a7b1af09e97271be3da74d336a64435e759a.tar.bz2
nx-libs-5987a7b1af09e97271be3da74d336a64435e759a.zip
Dialog.c,Display.c,Font.c,NXdixfonts.c: don't use hardcoded string buffer lengths
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/Display.c')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Display.c6
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);