mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vojtech Pavlik <vojtech@suse.cz>
To: "Randy.Dunlap" <rddunlap@osdl.org>
Cc: "Martin Mares" <mj@ucw.cz>,
	"Jörn Engel" <joern@wohnheim.fh-wedel.de>,
	linux-kernel@vger.kernel.org
Subject: Re: [BUG] in drivers/char/joystick/magellan.c
Date: Tue, 28 Jan 2003 22:03:53 +0100	[thread overview]
Message-ID: <20030128220353.A2892@ucw.cz> (raw)
In-Reply-To: <Pine.LNX.4.33L2.0301281045250.30636-100000@dragon.pdx.osdl.net>; from rddunlap@osdl.org on Tue, Jan 28, 2003 at 10:47:35AM -0800

On Tue, Jan 28, 2003 at 10:47:35AM -0800, Randy.Dunlap wrote:
> On Tue, 28 Jan 2003, Martin Mares wrote:
> 
> | 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.
> 
> The closest that I find in a quick scan is:
> 
> ANSI/ISO/IEC 9899-1999, page 126, section 6.7.8, constraint 14:
> 
> An array of character type may be initialized by a character string
> literal, optionally enclosed in braces. Successive characters of the
> character string literal (including the terminating null character if
> there is room or if the array is of unknown size) initialize the
> elements of the array.

Which means it was OK.

-- 
Vojtech Pavlik
SuSE Labs

  reply	other threads:[~2003-01-28 20:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-28 15:53 Jörn Engel
2003-01-28 15:57 ` Vojtech Pavlik
2003-01-28 15:59   ` Jörn Engel
2003-01-29 13:59   ` Horst von Brand
2003-01-28 17:57 ` Martin Mares
2003-01-28 18:10   ` Jörn Engel
2003-01-28 18:47   ` Randy.Dunlap
2003-01-28 21:03     ` Vojtech Pavlik [this message]
2003-01-29 12:25       ` Jörn Engel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030128220353.A2892@ucw.cz \
    --to=vojtech@suse.cz \
    --cc=joern@wohnheim.fh-wedel.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mj@ucw.cz \
    --cc=rddunlap@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®