--- a/plugins/spellchk.c Mon May 02 15:27:40 2005 -0400
+++ b/plugins/spellchk.c Mon May 02 22:52:08 2005 -0400
@@ -302,24 +302,24 @@
+ char *name, *tempfilename; - char tempfilename[BUF_LONG];
name = g_build_filename(gaim_user_dir(), "dict", NULL);
- strcpy(tempfilename, name);
- strcat(tempfilename,".XXXXXX");
+ tempfilename = g_strdup_printf("%s.XXXXXX", name); fd = g_mkstemp(tempfilename);
if (!(f = fdopen(fd, "w"))) {
@@ -342,10 +342,12 @@
"Error writing to %s: %m\n", tempfilename);
g_rename(tempfilename, name);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/protocols/zephyr/ZLocations.c Mon May 02 22:52:08 2005 -0400
@@ -0,0 +1,161 @@
+/* This file is part of the Project Athena Zephyr Notification System. + * It contains source for the ZSetLocation, ZUnsetLocation, and + * ZFlushMyLocations functions. + * Created by: Robert French + * Copyright (c) 1987,1988,1991 by the Massachusetts Institute of Technology. + * For copying and distribution information, see the file +static char rcsid_ZLocations_c[] = + "$Zephyr: /afs/athena.mit.edu/astaff/project/zephyr/src/lib/RCS/ZLocations.c,v 1.30 90/12/20 03:04:39 raeburn Exp $"; +Code_t ZSetLocation(exposure) + return (Z_SendLocation(LOGIN_CLASS, exposure, ZAUTH, + "$sender logged in to $1 on $3 at $2")); + return (Z_SendLocation(LOGIN_CLASS, LOGIN_USER_LOGOUT, ZNOAUTH, + "$sender logged out of $1 on $3 at $2")); +Code_t ZFlushMyLocations() + return (Z_SendLocation(LOGIN_CLASS, LOGIN_USER_FLUSH, ZAUTH, "")); +static char host[MAXHOSTNAMELEN], mytty[MAXPATHLEN]; +Code_t Z_SendLocation(class, opcode, auth, format) + ZNotice_t notice, retnotice; +#ifndef X_DISPLAY_MISSING + short wg_port = ZGetWGPort(); + (void) memset((char *)¬ice, 0, sizeof(notice)); + notice.z_port = (unsigned short) ((wg_port == -1) ? 0 : wg_port); + notice.z_class = class; + notice.z_class_inst = ZGetSender(); + notice.z_opcode = opcode; + notice.z_recipient = ""; + notice.z_num_other_fields = 0; + notice.z_default_format = format; + keep track of what we said before so that we can be consistent + when changing location information. + This is done mainly for the sake of the WindowGram client. + if (gethostname(host, MAXHOSTNAMELEN) < 0) + hent = gethostbyname(host); + (void) strncpy(host, hent->h_name, sizeof(host)); + host[sizeof(host) - 1] = '\0'; +#ifndef X_DISPLAY_MISSING + if ((display = getenv("DISPLAY")) && *display) { + (void) strncpy(mytty, display, sizeof(mytty)); + p = strchr(ttyp + 1, '/'); + strcpy(mytty, (p) ? p + 1 : ttyp); + strcpy(mytty, "unknown"); +#ifndef X_DISPLAY_MISSING + ourtime = time((time_t *)0); + bptr[1] = ctime(&ourtime); + bptr[1][strlen(bptr[1])-1] = '\0'; + if ((retval = ZSendList(¬ice, bptr, 3, auth)) != ZERR_NONE) + retval = Z_WaitForNotice (&retnotice, ZCompareUIDPred, ¬ice.z_uid, + if (retval != ZERR_NONE) + if (retnotice.z_kind == SERVNAK) { + if (!retnotice.z_message_len) { + ZFreeNotice(&retnotice); + if (!strcmp(retnotice.z_message, ZSRVACK_NOTSENT)) { + ZFreeNotice(&retnotice); + return (ZERR_AUTHFAIL); + if (!strcmp(retnotice.z_message, ZSRVACK_FAIL)) { + ZFreeNotice(&retnotice); + return (ZERR_LOGINFAIL); + ZFreeNotice(&retnotice); + if (retnotice.z_kind != SERVACK) { + ZFreeNotice(&retnotice); + return (ZERR_INTERNAL); + if (!retnotice.z_message_len) { + ZFreeNotice(&retnotice); + return (ZERR_INTERNAL); + if (strcmp(retnotice.z_message, ZSRVACK_SENT) && + strcmp(retnotice.z_message, ZSRVACK_NOTSENT)) { + ZFreeNotice(&retnotice); + return (ZERR_INTERNAL); + ZFreeNotice(&retnotice);