From a0b4a1330be6a36ad095222d2ea83927cd33514d Mon Sep 17 00:00:00 2001 From: marha Date: Fri, 25 Nov 2011 08:22:48 +0100 Subject: mesa xserver pixman git update 25 nov 2011 --- xorg-server/hw/dmx/config/Makefile.am | 4 ++++ xorg-server/hw/dmx/config/dmxcompat.c | 4 ++-- xorg-server/hw/dmx/config/scanner.l | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) (limited to 'xorg-server/hw/dmx/config') 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 #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 #include #include @@ -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); -- cgit v1.2.3