|
On Thu, Mar 16, 2000 at 05:22:32PM -0500, Sean Porterfield wrote: > > /* Convert a signed decimal field to a C `int' */ > > static int > > signed2int (buf, len) > > Byte *buf; > > int len; > > { > > int v = 0; > > while (len) > > { > > v *= 10; > > v += buf[0] & 0x0f; > > len--; > > if (--len == 0 && (buf[0] & 0xf0) == 0xd0) > > v = -v; > > buf++; > > } > > return v; > > } > > > > It seems we were checking the zone of a random garbage character (the first > > character after the end of the field). I've just fixed this in CVS. > > > > -Jay 'Eraserhead' Felice > > > > CVS code doesn't have the len--; line in it. When I keyed exactly as you >have it > here, I got a seg fault/core dump when it was "RETR QTEMP/FIELDS" Eek. The "len--;" is incorrect, apologies. > > Using the code from CVS does not cause the crash. I haven't checked for any >other > problems yet. > > Thanks for your quick response! > > Sean > +--- | This is the LINUX5250 Mailing List! | To submit a new message, send your mail to LINUX5250@midrange.com. | To subscribe to this list send email to LINUX5250-SUB@midrange.com. | To unsubscribe from this list send email to LINUX5250-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.