[dlls/opengl32/wgl.c] Strncpy elimination.

Peter Berg Larsen pebl at math.ku.dk
Sun Mar 27 12:06:44 CST 2005


I have been checking the usage of strncpy, replacing where apropriate with
a memcpy or lstrcpyn[AW]. The first raw diff was 100kb, so there is bound
to be one or two slips. These are the first batch which I found to be
obvious, correct, and didnt need a special comment. Note with correct I
mean if there was a \0 bug before then it still there.

Changelog:
	Janitorial Task: Check the usage of strncpy/strncpyW.

Index: dlls/opengl32/wgl.c
===================================================================
RCS file: /home/wine/wine/dlls/opengl32/wgl.c,v
retrieving revision 1.54
diff -u -r1.54 wgl.c
--- dlls/opengl32/wgl.c	10 Mar 2005 11:13:33 -0000	1.54
+++ dlls/opengl32/wgl.c	26 Mar 2005 09:40:56 -0000
@@ -390,7 +390,7 @@
 	 OpenGL drivers (moreover, it is only useful for old 1.0 apps
 	 that query the glBindTextureEXT extension).
       */
-      strncpy(buf, ext_ret->glx_name, strlen(ext_ret->glx_name) - 3);
+      memcpy(buf, ext_ret->glx_name, strlen(ext_ret->glx_name) - 3);
       buf[strlen(ext_ret->glx_name) - 3] = '\0';
       TRACE(" extension not found in the Linux OpenGL library, checking against libGL bug with %s..\n", buf);






More information about the wine-patches mailing list