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. [...]