2005/12/31, Yi Yang <yang.y.yi@xxxxxxxxx>:I want to remind of you, my program is an example to verify this bug, it can run on both little-endian and big-endian computer correctly, because the variable target is 0x00000001 or 0x00000000, it sets 0 to the tail of osname, only a byte '\01' isn't expected for little-endian, but my program really can run correctly.
Coywolf Qi Hunt wrote:
You didn't set the trailing '\0', I wonder how your printf did workThe variable target does it, its value is 0x00000001, so you mustn't
properly ever. You've just been lucky or something.
-- Coywolf
worry it.
osname only has 4-bytes space, so if you set '\0' to its tail, a byte
information will be lost.
I'm worrying more. We should set '\0'. Let the one byte information
lost, the caller deserve that. Actually here printf sees "mylo"+'\01'
if little endian.
Linus, besides fixing bug, your commit certainly breaks userland
compatibility. Please consider.
--
Coywolf Qi Hunt