[Ecls-list] Sockets broken?

Juan Jose Garcia-Ripoll jjgarcia at users.sourceforge.net
Sat Oct 13 10:24:30 UTC 2007


I think the right code should be as follows:

	if (t == t_base_string) {
		ok = (size <= x->base_string.dim);
	} else if (t == t_vector) {
		cl_elttype aet = (cl_elttype)x->vector.elttype;
		if (aet == aet_b8 || aet == aet_i8 || aet == aet_bc) {
			ok = (size <= x->vector.dim);
		} else if (aet == aet_fix || aet == aet_index) {
			cl_index divisor = sizeof(cl_index);
			size = (size + divisor - 1) / divisor;
			ok = (size <= x->vector.dim);
		}
	}

The size can be as large as the buffer dimension in the case of
character and byte buffers. In the case of vectors of type "fixnum" or
"index", the size has to be a rounded integer that can contain at
least that many characters.

Do you agree? Shall I commit this fix?

Juanjo

-- 
Facultad de Fisicas, Universidad Complutense,
Ciudad Universitaria s/n Madrid 28040 (Spain)
http://juanjose.garciaripoll.googlepages.com




More information about the ecl-devel mailing list