Re: Ancient C string conventions

2010-06-30 Thread Paul Rubin
Jorgen Grahn writes: > It's somewhat believable. If I handled thousands of student names in a > big C array char[30][], I would resent the fact that 1/30 of the > memory was wasted on NUL bytes. But you'd be wasting even more of the memory on bytes left unused when the student's name is less tha

Ancient C string conventions (was Re: Why Is Escaping Data Considered So Magical?)

2010-06-30 Thread Jorgen Grahn
On Wed, 2010-06-30, Carl Banks wrote: > On Jun 28, 2:44 am, Gregory Ewing wrote: >> Carl Banks wrote: >> > Indeed, strncpy does not copy that final NUL if it's at or beyond the >> > nth element.  Probably the most mind-bogglingly stupid thing about the >> > standard C library, which has lots of mi