BB Unix Network Monitor - Message

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: {bb} Fix: problem with mailing acks with more than one word



On Tue, 2006-03-28 at 00:25, Philip Clark wrote:
> That's odd. The routine "bb_doack" in the file bbpage.c contains the
> line:
>        replacestr(message,sizeof(message),"+"," ");
> 
> So, the plus characters are at least expected. I also had a quick look
> at the source for "bb" and I couldn't see anything that would cause it
> to have a problem with the plus characters.
> 
> I'll keep digging.

Wouldn't you know it? I actually included the line that was causing
the error above :) It took a while to identify it though, 'cos I have
not done any serious C hacking for years.

The problem is this. With a character array, "sizeof" will return
the length of the array. In this case, however, "message" is just
a pointer and "sizeof" will give you the size of the pointer. For
me that's 4, but it's not a very useful number.

Modifying the line to read:

    replacestr(message,strlen(message) + 1,"+"," ");

appears to give me the correct behaviour.

The problem now is that there are 89 other calls to "replacestr".
I'd expect that they could probably all be modified in the same
way, but I'm too lazy to check each one.

Cheers, Phil.


 
-- 
Writing about music is like dancing about architecture.
(Frank Zappa)

--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=
To unsubscribe from this list, or to subscribe to the bb-digest list
send e-mail to mailto:majordomo@bb4.com with unsubscribe bb -and/or-
subscribe bb-digest in the BODY of the message.


Home | Main Index | Thread Index