diff options
author | marha <marha@users.sourceforge.net> | 2011-11-25 08:22:48 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-11-25 08:22:48 +0100 |
commit | a0b4a1330be6a36ad095222d2ea83927cd33514d (patch) | |
tree | 616920ca608751e843c92c9815069f43789e3097 /xorg-server/hw/dmx/config | |
parent | 45710577f374972946a8eb37833a9c94e5a299bf (diff) | |
download | vcxsrv-a0b4a1330be6a36ad095222d2ea83927cd33514d.tar.gz vcxsrv-a0b4a1330be6a36ad095222d2ea83927cd33514d.tar.bz2 vcxsrv-a0b4a1330be6a36ad095222d2ea83927cd33514d.zip |
mesa xserver pixman git update 25 nov 2011
Diffstat (limited to 'xorg-server/hw/dmx/config')
-rw-r--r-- | xorg-server/hw/dmx/config/Makefile.am | 4 | ||||
-rw-r--r-- | xorg-server/hw/dmx/config/dmxcompat.c | 4 | ||||
-rw-r--r-- | xorg-server/hw/dmx/config/scanner.l | 3 |
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); |