Re: [BUG] in drivers/char/joystick/magellan.c

From: Martin Mares (mj@ucw.cz)
Date: Tue Jan 28 2003 - 12:57:57 EST


Hi!

> Without the patch below, the \0 terminating the string is written
> anywhere. nibbles[] would be even better, I guess.
> Can you check for stupidity on my side?

As far as I remember, the ANSI C permits initialization of a char array
with a string of the same length and defines that the trailing \0 is
dropped in such cases. However, I cannot quote the right chapter and
verse by heart nor am I sure it's still permitted by C99, so better
check yourself.

                                Have a nice fortnight

-- 
Martin `MJ' Mares   <mj@ucw.cz>   http://atrey.karlin.mff.cuni.cz/~mj/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
return(EIEIO); /* Here-a-bug, There-a-bug... */
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Jan 31 2003 - 22:00:20 EST