Thanks! It didn't even occur to me to check this out. My only excuse is gratuitous consistency and lack of pure C experience; a malloc() without a corresponding sizeof() seemed a little arbitrary to me, but it makes sense now :-)
/Pär 2014-10-21 17:46 GMT+02:00 Micah Cowan <[email protected]>: > On Mon, Oct 20, 2014 at 7:02 PM, Yousong Zhou <[email protected]> > wrote: > > I am not sure here. Do we always assume sizeof(char) to be 1 for > > platforms supported by wget? > > FWIW, sizeof(char) is always 1 by definition; the C standard > guarantees it. Even on systems with no addressable values smaller than > 16 bits, because on such systems, C defines a "byte" to be 16 bits > (recall that, originally at least, a byte isn't necessarily an octet, > and that's the meaning the C standards use). > > If a platform doesn't have sizeof(char) == 1, it's not the C language. :) > > -mjc >
