[gaim-migrate @ 12612]

Tue, 03 May 2005 02:52:39 +0000

author
Mark Doliner <markdoliner@pidgin.im>
date
Tue, 03 May 2005 02:52:39 +0000
changeset 10897
98867eee9779
parent 10896
b773b241e233
child 10898
d5feea33d82a

[gaim-migrate @ 12612]
This might be a tiny bit clearer. It might also be uglier.

src/protocols/zephyr/ZLocations.c file | annotate | diff | comparison | revisions
--- 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

mercurial