Mercurial > pidgin.yaz
annotate src/protocols/zephyr/ZGetWGPort.c @ 11849:dc51cdcb648e
[gaim-migrate @ 14140]
sf patch #1339135, from Sadrul Habib Chowdhury
Hi. Bleeter found this bug:
(1) open up some conversation window
(2) open the smiley dialog
(3) close the conversation window. the smiley dialog
remains open
(4) select some smiley
(5) Gaim crashes
This patch fixes this crash. It shouldn't cause any
probs with regards to gtk-version-checking. The other
code handling the smiley-dialog doesn't do the
version-checking, so this shouldn't be necessary either.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Thu, 27 Oct 2005 12:00:17 +0000 |
parents | 64895571248f |
children |
rev | line source |
---|---|
2086 | 1 /* This file is part of the Project Athena Zephyr Notification System. |
2 * It contains source for the ZGetWGPort function. | |
3 * | |
4 * Created by: Robert French | |
5 * | |
6 * Copyright (c) 1987 by the Massachusetts Institute of Technology. | |
7 * For copying and distribution information, see the file | |
8 * "mit-copyright.h". | |
9 */ | |
10 | |
8792
43d6c08d7e96
[gaim-migrate @ 9554]
Christian Hammond <chipx86@chipx86.com>
parents:
2086
diff
changeset
|
11 #include "internal.h" |
2086 | 12 |
13 int ZGetWGPort() | |
14 { | |
15 char *envptr, name[128]; | |
16 FILE *fp; | |
17 int wgport; | |
10867 | 18 #ifdef WIN32 |
19 long int buffsize= 128; | |
20 char tempdir[buffsize]; | |
21 #endif | |
2086 | 22 envptr = getenv("WGFILE"); |
23 if (!envptr) { | |
10867 | 24 #ifdef WIN32 |
25 GetTempPath(buffsize,tempdir); | |
26 GetTempFileName(tempdir,"wg.",0,name); | |
27 #else | |
2086 | 28 (void) sprintf(name, "/tmp/wg.%d", getuid()); |
10867 | 29 #endif |
2086 | 30 envptr = name; |
31 } | |
10592
d72fffd1b1ad
[gaim-migrate @ 11998]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10589
diff
changeset
|
32 if (!(fp = fopen(envptr, "r"))) |
2086 | 33 return (-1); |
34 | |
35 /* if fscanf fails, return -1 via wgport */ | |
36 if (fscanf(fp, "%d", &wgport) != 1) | |
37 wgport = -1; | |
38 | |
39 (void) fclose(fp); | |
40 | |
41 return (wgport); | |
42 } |