Mercurial > pidgin
comparison src/protocols/zephyr/ZLocations.c @ 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 | 5727afad0fb8 |
children | 64895571248f |
comparison
equal
deleted
inserted
replaced
10896:2714b51a0dad | 10897:04cb7363260d |
---|---|
95 host[sizeof(host) - 1] = '\0'; | 95 host[sizeof(host) - 1] = '\0'; |
96 } | 96 } |
97 #ifndef X_DISPLAY_MISSING | 97 #ifndef X_DISPLAY_MISSING |
98 if ((display = getenv("DISPLAY")) && *display) { | 98 if ((display = getenv("DISPLAY")) && *display) { |
99 (void) strncpy(mytty, display, sizeof(mytty)); | 99 (void) strncpy(mytty, display, sizeof(mytty)); |
100 mytty[sizeof(mytty)-1] = '\0'; | |
101 } else { | 100 } else { |
102 #endif | 101 #endif |
103 #ifdef WIN32 | 102 #ifdef WIN32 |
104 strcpy(mytty,"WinGaim"); | 103 strncpy(mytty, "WinGaim", sizeof(mytty)); |
105 #else | 104 #else |
106 ttyp = ttyname(0); | 105 ttyp = ttyname(0); |
107 if (ttyp && *ttyp) { | 106 if (ttyp && *ttyp) { |
108 p = strchr(ttyp + 1, '/'); | 107 p = strchr(ttyp + 1, '/'); |
109 strcpy(mytty, (p) ? p + 1 : ttyp); | 108 strcpy(mytty, (p) ? p + 1 : ttyp); |
110 } else { | 109 } else { |
111 strcpy(mytty, "unknown"); | 110 strncpy(mytty, "unknown", sizeof(mytty)); |
112 } | 111 } |
113 #endif | 112 #endif |
113 mytty[sizeof(mytty)-1] = '\0'; | |
114 #ifndef X_DISPLAY_MISSING | 114 #ifndef X_DISPLAY_MISSING |
115 } | 115 } |
116 #endif | 116 #endif |
117 reenter = 1; | 117 reenter = 1; |
118 } | 118 } |