All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>,
	akpm@osdl.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [patch 6/6] s390: qeth network driver.
Date: Tue, 30 Nov 2004 17:50:56 +0000	[thread overview]
Message-ID: <1101837055.25617.70.camel@localhost.localdomain> (raw)
In-Reply-To: <41ACB253.9090202@pobox.com>

On Maw, 2004-11-30 at 17:48, Jeff Garzik wrote:
> > +		/* String must not be longer than PAGE_SIZE. So we check for
> > +		 * length >= 3900 here. Then we can savely display the next
> > +		 * IPv6 address and our info message below */
> > +		if (i >= 3900) {
> > +			i += sprintf(buf + i,
> > +				     "... Too many entries to be displayed. "
> > +				     "Skipping remaining entries.\n");
> > +			break;
> > +		}
> 
> 
> ACK, although I dislike the open-coding of the magic number 3900.

Use snprintf and the problem goes away I think
	
	static char *errorstring = "...  "

	errorlen = strlen(errorstring);

	If(i < PAGE_SIZE - errorlen)
		i += snprintf(buf + i, PAGE_SIZE - i, ...)
	else {
		memcpy(buf+i, errorstring, errorlen);
		i += errorlen;
		break;
	}

  reply	other threads:[~2004-11-30 18:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-30 15:10 [patch 6/6] s390: qeth network driver Martin Schwidefsky
2004-11-30 17:48 ` Jeff Garzik
2004-11-30 17:50   ` Alan Cox [this message]
2004-11-30 18:15     ` Alan Cox

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=1101837055.25617.70.camel@localhost.localdomain \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=akpm@osdl.org \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=schwidefsky@de.ibm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.