mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@caldera.de>
To: tori@tellus.mine.nu (Tobias Ringstrom)
Cc: linux-kernel@vger.kernel.org
Subject: Re: Too long network device names corrupts kernel
Date: Thu, 23 Nov 2000 17:37:11 +0100	[thread overview]
Message-ID: <200011231637.RAA25892@ns.caldera.de> (raw)
In-Reply-To: <Pine.LNX.4.21.0011231642110.32263-100000@svea.tellus>

In article <Pine.LNX.4.21.0011231642110.32263-100000@svea.tellus> you wrote:
> Btw, does anyone know of a C function that works like strncpy, but does
> add a terminating null character, event if the string does not fit, ro
> does one have to do str[5]=0 first, and then strncpy(str,src,4)?

strlcpy.

Check 'http://www.FreeBSD.org/cgi/man.cgi?query=strlcpy&apropos=0&sektion=0&
manpath=OpenBSD+2.6&format=html' for details.

Originally for OpenBSD, most UNICES (NetBSD, FreeBSD, Solaris,
UnixWare, OpenServer) have it in libc now.

Glibc is missing it because my patch did not get accepted.

If there is interest in having this in the kernel I could come up with a patch.

	Christoph

-- 
Always remember that you are unique.  Just like everyone else.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

  reply	other threads:[~2000-11-23 17:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-11-23 16:02 Tobias Ringstrom
2000-11-23 16:37 ` Christoph Hellwig [this message]
2000-11-23 21:17 ` Michael Richardson

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=200011231637.RAA25892@ns.caldera.de \
    --to=hch@caldera.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tori@tellus.mine.nu \
    /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®