>>>>> "Y" == Yukihiro Matsumoto <matz / ruby-lang.org> writes:

Y> -    if ( len + at >= e->bufsize )
Y> +    while ( len + at >= e->bufsize )

 Well, I don't understand sorry. For me the problem is in the for (;;)

        syck_emitter_flush( e, 0 );
	for (;;) {
	    long rest = e->bufsize - (e->marker - e->buffer);
	    if (len <= rest) break;
	    S_MEMCPY( e->marker, str, char, rest );
	    e->marker += len;
	    str += rest;
	    len -= rest;
	    syck_emitter_flush( e, 0 );
	}

 With the first flush(), if e->marker == e->buffer, rest will be equal to
 e->bufsize 

 e->marker is incremented with len (> e->bufsize)

 in the second flush() e->marker can, at more, be decremented with
 e->bufsize and depending on the value of len you can have
 (e->marker - e->buffer) > e->bufsize


Guy Decoux