Tue, 03 May 2005 02:52:39 +0000
[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