aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/dmx/config
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-11-25 08:32:21 +0100
committermarha <marha@users.sourceforge.net>2011-11-25 08:32:21 +0100
commit849d328b25c2f3c87d539e1fe7af38e7580a0409 (patch)
tree349c425a87ddb3aaa1d7832d5a8e68252fc73ddb /xorg-server/hw/dmx/config
parenta8a12d4c8be177f63cae7dc96c2b52f09e228a76 (diff)
parenta0b4a1330be6a36ad095222d2ea83927cd33514d (diff)
downloadvcxsrv-849d328b25c2f3c87d539e1fe7af38e7580a0409.tar.gz
vcxsrv-849d328b25c2f3c87d539e1fe7af38e7580a0409.tar.bz2
vcxsrv-849d328b25c2f3c87d539e1fe7af38e7580a0409.zip
Merge remote-tracking branch 'origin/released'
Conflicts: xorg-server/glx/glxdriswrast.c xorg-server/glx/single2.c xorg-server/hw/xwin/winconfig.c xorg-server/os/osinit.c xorg-server/os/xdmcp.c xorg-server/xkb/xkbInit.c
Diffstat (limited to 'xorg-server/hw/dmx/config')
-rw-r--r--xorg-server/hw/dmx/config/Makefile.am4
-rw-r--r--xorg-server/hw/dmx/config/dmxcompat.c4
-rw-r--r--xorg-server/hw/dmx/config/scanner.l3
3 files changed, 8 insertions, 3 deletions
diff --git a/xorg-server/hw/dmx/config/Makefile.am b/xorg-server/hw/dmx/config/Makefile.am
index de4ce315d..75181436e 100644
--- a/xorg-server/hw/dmx/config/Makefile.am
+++ b/xorg-server/hw/dmx/config/Makefile.am
@@ -22,6 +22,10 @@ MAINTAINERCLEANFILES = $(BUILT_SOURCES)
libdmxconfig_a_SOURCES = $(LIBSRCS)
+if NEED_STRLCAT
+libdmxconfig_a_SOURCES += $(top_srcdir)/os/strlcpy.c
+endif
+
if GLX
GLX_DEFS = @GL_CFLAGS@
endif
diff --git a/xorg-server/hw/dmx/config/dmxcompat.c b/xorg-server/hw/dmx/config/dmxcompat.c
index b4190ffcc..1c72084fa 100644
--- a/xorg-server/hw/dmx/config/dmxcompat.c
+++ b/xorg-server/hw/dmx/config/dmxcompat.c
@@ -42,6 +42,7 @@
#include <dmx-config.h>
#endif
+#include "os.h"
#include "dmxconfig.h"
#include "dmxparse.h"
#include "dmxcompat.h"
@@ -94,8 +95,7 @@ static void dmxVDLDisplayEntry(const char *buf,
char *end;
pt = strchr(buf, ' ');
- strncpy(name, buf, pt-buf);
- name[pt-buf] = '\0';
+ strlcpy(name, buf, 1+pt-buf);
*len = strlen(name);
*x = strtol(pt, &end, 10);
diff --git a/xorg-server/hw/dmx/config/scanner.l b/xorg-server/hw/dmx/config/scanner.l
index cef99d088..e527d6df5 100644
--- a/xorg-server/hw/dmx/config/scanner.l
+++ b/xorg-server/hw/dmx/config/scanner.l
@@ -39,6 +39,7 @@
#include "dmxparse.h"
#include "parser.h"
+#include "os.h"
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
@@ -152,7 +153,7 @@ static int getdimension(int token, const char *text, int leng)
char *tmp = dmxConfigAlloc(leng+1);
int x, y;
- strncpy(tmp, text, leng);
+ strlcpy(tmp, text, leng+1);
x = strtol(tmp, &endptr, 10);
while (*endptr && !isdigit(*endptr)) ++endptr;
y = strtol(endptr, NULL, 10);