Thread View: net.bugs.usg
3 messages
3 total messages
Started by guy
Sun, 05 Oct 1986 20:36
"mailx" screws up "reply" addresses in some cases
Author: guy
Date: Sun, 05 Oct 1986 20:36
Date: Sun, 05 Oct 1986 20:36
70 lines
2474 bytes
2474 bytes
For example, when you have a message such as:
From homer@bu-cs.bu.edu Tue Sep 30 20:58:11 1986
Received: by bu-cs.bu.edu (5.31/4.7)
id AA21517; Tue, 30 Sep 86 20:58:06 EDT
Return-Path: <homer@bu-cs.bu.edu>
Received: by bucse.bu.edu (5.31/4.7)
id AA16172; Tue, 30 Sep 86 20:57:55 EDT
Date: Tue, 30 Sep 86 20:57:55 EDT
From: homer@bu-cs.bu.edu
Message-Id: <8610010057.AA16172@bucse.bu.edu>
To: ab, alpert, karenl, veress
Subject: changes
Text text text text text...
and try a "reply", it sends N copies to "veress@bu-cs.bu.edu".
The problem is that a static buffer is being used for the address, and it
isn't saving that static buffer before using it for the next address; since
it sticks a pointer to that address in the structure representing a name,
all the names end up being the last name stuffed into that buffer.
The fix, to "optim.c", is:
------- optim.c -------
*** /tmp/da0248 Sun Oct 5 13:36:02 1986
--- optim.c Sat Oct 4 02:04:18 1986
***************
*** 239,245 ****
char from[];
{
register char *cp;
! static char rbuf[200];
if (debug) fprintf(stderr, "makeremote(%s, %s) returns ", name, from);
strcpy(rbuf, name);
--- 239,245 ----
char from[];
{
register char *cp;
! char rbuf[BUFSIZ];
if (debug) fprintf(stderr, "makeremote(%s, %s) returns ", name, from);
strcpy(rbuf, name);
***************
*** 248,254 ****
cp = rindex(from, '%');
strcat(rbuf, cp);
if (debug) fprintf(stderr, "%s\n", rbuf);
! return rbuf;
}
/*
--- 248,254 ----
cp = rindex(from, '%');
strcat(rbuf, cp);
if (debug) fprintf(stderr, "%s\n", rbuf);
! return(savestr(rbuf));
}
/*
which allocates a new string buffer for each recipient and returns a point
to it instead of a pointer to the local buffer. Since the local buffer is
now purely temporary, it is made automatic.
--
Guy Harris
{ihnp4, decvax, seismo, decwrl, ...}!sun!guy
guy@sun.com (or guy@sun.arpa)
Re: "mailx" screws up "reply" addresses in some cases
Author: Daniel R. Levy
Date: Tue, 07 Oct 1986 17:32
Date: Tue, 07 Oct 1986 17:32
62 lines
2364 bytes
2364 bytes
In article <7926@sun.uucp>, guy@sun.UUCP writes:
>The fix, to "optim.c", is:
>
>------- optim.c -------
>*** /tmp/da0248 Sun Oct 5 13:36:02 1986
>--- optim.c Sat Oct 4 02:04:18 1986
>***************
>*** 239,245 ****
> char from[];
> {
> register char *cp;
>! static char rbuf[200];
>
> if (debug) fprintf(stderr, "makeremote(%s, %s) returns ", name, from);
^(void)
> strcpy(rbuf, name);
^(void)
>--- 239,245 ----
> char from[];
> {
> register char *cp;
>! char rbuf[BUFSIZ];
>
> if (debug) fprintf(stderr, "makeremote(%s, %s) returns ", name, from);
> strcpy(rbuf, name);
>***************
>*** 248,254 ****
> cp = rindex(from, '%');
> strcat(rbuf, cp);
^(void)
> if (debug) fprintf(stderr, "%s\n", rbuf);
^(void)
>! return rbuf;
> }
>
> /*
>--- 248,254 ----
> cp = rindex(from, '%');
> strcat(rbuf, cp);
> if (debug) fprintf(stderr, "%s\n", rbuf);
>! return(savestr(rbuf));
> }
>
> /*
>which allocates a new string buffer for each recipient and returns a point
>to it instead of a pointer to the local buffer. Since the local buffer is
>now purely temporary, it is made automatic.
> Guy Harris
Hey, while you're making fixes to the "functionality" (love that non-word...)
why not make lint fixes too?
--
------------------------------- Disclaimer: The views contained herein are
| dan levy | yvel nad | my own and are not at all those of my em-
| an engihacker @ | ployer or the administrator of any computer
| at&t computer systems division | upon which I may hack.
| skokie, illinois |
-------------------------------- Path: ..!{akgua,homxb,ihnp4,ltuxa,mvuxa,
go for it! allegra,ulysses,vax135}!ttrdc!levy
Re: "mailx" screws up "reply" addresses in some cases
Author: Guy Harris
Date: Thu, 09 Oct 1986 07:31
Date: Thu, 09 Oct 1986 07:31
23 lines
1405 bytes
1405 bytes
> Hey, while you're making fixes to the "functionality" (love that
> non-word...)
From "The Merriam-Webster Webster's Third New International Dictionary":
func*tion*al*i*ty n -ES : the quality, state, or relation
of being functional : UTILITY : INTERRELATION
So it's a word, although not meaning what computeroids use it to mean....
> why not make lint fixes too?
I did - about 10 tons of them - and posted them a long while ago. After a
while, though, you reach the point of diminishing returns, and frankly I'd
gotten tired of throwing "(void)"s into somebody else's code. I didn't see
much point in throwing them in in new code when they weren't there in the
existing code.
If you want to run all of "mailx" or "Mail" through "lint", be my guest....
--
Guy Harris
{ihnp4, decvax, seismo, decwrl, ...}!sun!guy
guy@sun.com (or guy@sun.arpa)
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads