Win Tims Money! a.k.a. find my sockets bug!
Tim Rowledge
tim at sumeru.stanford.edu
Fri Apr 21 20:45:57 UTC 2000
In message <200004212016.PAA09260 at dcs-server1.cs.uiuc.edu> you wrote:
> Ok, found it I'll only claim a $1.00 since I've not posted the solution
> however in the code given this problem:
>
> D0DA0301 is the byte array for www.disney.com (208.218.3.1)
>
> when you invoke
> addr = netAddressToInt(address);
>
> then addr gets
> CFDA0301 which of course is 207.218.3.1
>
> The problem lurks in netAddressToInt when it grabs bytes and shifts then
> adds them I think some compilers think and do signed math?
Yup, that's it. Hacking the generated C to use unsigned char* instead of
char * makes it work. I'll clean up the slang later after a drunken orgy
of celebration. Thank you John, you get the prize, the adulation, the
girls/boys/goats (delete as appropriate).
Oh, the joy of C. :-(
tim
--
Tim Rowledge, tim at sumeru.stanford.edu, http://sumeru.stanford.edu/tim
To be, or not to be, those are the parameters.
More information about the Squeak-dev
mailing list
|