Streams adjmsg bug

Linwood Varney linwood at b11.ingr.com
Wed Aug 9 16:23:09 AEST 1989


The streams function adjmsg() will fail in certain cases if trimming
bytes from the end of a message.  If adjmsg() is passed a message that
contains more than one message block, or more specifically if the last
message block is larger than the number of bytes you wish to trim off.

The while statement in the function adjmsg():

		bp = mp;
		while (len && bp) {
			bp = mp;

fails the second time through since bp is also used within an inner loop.
If the while statement is changed to:

/*		bp = mp;	(statement no longer needed */
		while (len) {
			bp = mp;

the function works as documented.

	- Linwood Varney		linwood at ingr.com
	  Network Communications	Intergraph Corp.



More information about the Comp.bugs.sys5 mailing list