Date: Fri, 20 Jun 1997 04:35:55 +1000 From: Bruce Evans <bde@zeta.org.au> To: bde@zeta.org.au, jkh@time.cdrom.com Cc: cvs-all@FreeBSD.ORG, cvs-bin@FreeBSD.ORG, cvs-committers@FreeBSD.ORG, jkh@FreeBSD.ORG Subject: Re: cvs commit: src/bin/sh expand.c Message-ID: <199706191835.EAA18554@godzilla.zeta.org.au>
next in thread | raw e-mail | index | archive | help
>> Submitted patches are almost never suitable for committing directly. > >Well, I did look at it first, sheesh! ;) Given the mastications that >sh was doing on the value of the integer there, the fix seemed >perfectly correct so I committed it. I didn't know I was walking into Yes, the fix seems to address another bug. The home made itoa() is obviously wrong for all negative values. Now it is only obviously wrong when the negation causes overflow :-). Apart from giving undefined behaviour, the overflow normally gives a negative int so you are no closer to printing its absolute value. The fix leaves sh printing wrong exit values. After exit(255), sh prints $? as -1 (-1 is 255 shifted back and forth). Did you test all possible exit values? :-) Bruce
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199706191835.EAA18554>