diff src/video/x11/SDL_x11video.c @ 1379:c0a74f199ecf

Use only safe string functions
author Sam Lantinga <slouken@libsdl.org>
date Sun, 19 Feb 2006 23:46:34 +0000
parents 19418e4422cb
children d910939febfa
line wrap: on
line diff
--- a/src/video/x11/SDL_x11video.c	Sun Feb 19 23:38:57 2006 +0000
+++ b/src/video/x11/SDL_x11video.c	Sun Feb 19 23:46:34 2006 +0000
@@ -275,7 +275,7 @@
 	/* First allow environment variable override */
 	spot = SDL_getenv("SDL_VIDEO_X11_WMCLASS");
 	if ( spot ) {
-		SDL_strncpy(classname, spot, maxlen);
+		SDL_strlcpy(classname, spot, maxlen);
 		return classname;
 	}
 
@@ -293,16 +293,16 @@
 		linkfile[linksize] = '\0';
 		spot = SDL_strrchr(linkfile, '/');
 		if ( spot ) {
-			SDL_strncpy(classname, spot+1, maxlen);
+			SDL_strlcpy(classname, spot+1, maxlen);
 		} else {
-			SDL_strncpy(classname, linkfile, maxlen);
+			SDL_strlcpy(classname, linkfile, maxlen);
 		}
 		return classname;
 	}
 #endif /* linux */
 
 	/* Finally use the default we've used forever */
-	SDL_strncpy(classname, "SDL_App", maxlen);
+	SDL_strlcpy(classname, "SDL_App", maxlen);
 	return classname;
 }