changeset 10897:04cb7363260d

[gaim-migrate @ 12612] This might be a tiny bit clearer. It might also be uglier. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Tue, 03 May 2005 02:52:39 +0000
parents 2714b51a0dad
children cfacc0de0d94
files src/protocols/zephyr/ZLocations.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/zephyr/ZLocations.c	Tue May 03 02:39:55 2005 +0000
+++ b/src/protocols/zephyr/ZLocations.c	Tue May 03 02:52:39 2005 +0000
@@ -97,20 +97,20 @@
 #ifndef X_DISPLAY_MISSING
 	    if ((display = getenv("DISPLAY")) && *display) {
 		    (void) strncpy(mytty, display, sizeof(mytty));
-		    mytty[sizeof(mytty)-1] = '\0';
 	    } else {
 #endif
 #ifdef WIN32
-              	    strcpy(mytty,"WinGaim");
+              	    strncpy(mytty, "WinGaim", sizeof(mytty));
 #else
 		    ttyp = ttyname(0);
 		    if (ttyp && *ttyp) {
 			p = strchr(ttyp + 1, '/');
 			strcpy(mytty, (p) ? p + 1 : ttyp);
 		    } else {
-			strcpy(mytty, "unknown");
+			strncpy(mytty, "unknown", sizeof(mytty));
 		    }
 #endif
+		    mytty[sizeof(mytty)-1] = '\0';
 #ifndef X_DISPLAY_MISSING
 	    }
 #endif