On Mon, Apr 07, 2008 at 07:33:30PM -0700, Ben Calvert wrote: > > On Apr 7, 2008, at 2:20 PM, Tobias Ulmer wrote: >> On Mon, Apr 07, 2008 at 02:01:14PM -0700, [EMAIL PROTECTED] wrote: >>> Can we really assume that sizeof(char) is 1 ? >>> >>> >>> RCS file: /cvs/src/lib/libc/stdio/fgetln.3,v >>> retrieving revision 1.15 >>> diff -r1.15 fgetln.3 >>> 137c137 >>> < if ((lbuf = malloc(len + 1)) == NULL) >>> --- >>>> if ((lbuf = malloc( sizeof(char) * (len + 1))) == >>> NULL) >>> <[EMAIL PROTECTED]:/usr/src/lib/libc/stdio:633>$ >>> >>> >> >> Yes. >> >> 6.5.3.4 The sizeof operator >> [...] >> When applied to an operand that has type char, unsigned char, or signed >> char, (or a qualified version thereof) the result is 1. [...] > > I bow before your greater knowledge. Please don't... > > Is this the ansi standard you're quoting from? Is it available on-line > somewhere so I can spare the list further stupid questions? > > Ben >
Costs 250$/EUR or something last time i've checked. But there's a draft which is very close to the C99 standard: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf