David Bremner <david at tethera.net> writes: > + if (!gzgets (stream, buf + offset, len)) > + return -1; I did find one bug by setting the initial line size to 2. This should read "len - offset".