From: Harald Hoyer <harald@redhat.com>
To: linux-hotplug@vger.kernel.org
Subject: strnlen for klibc
Date: Thu, 15 Jul 2004 09:07:52 +0000 [thread overview]
Message-ID: <40F64968.3000907@redhat.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 34 bytes --]
this implements strnlen for klibc
[-- Attachment #2: udev-025-klibc-strnlen.patch --]
[-- Type: text/x-patch, Size: 854 bytes --]
--- udev-025/klibc/klibc/strlen.c.strnlen 2004-04-21 23:39:10.000000000 +0200
+++ udev-025/klibc/klibc/strlen.c 2004-06-02 15:25:47.840212248 +0200
@@ -12,3 +12,13 @@
return ss-s;
}
+size_t strnlen(const char *s, size_t maxlen)
+{
+ const char *ss = s;
+ while(*ss && (maxlen > 0)) {
+ ss++;
+ maxlen--;
+ }
+ return ss-s;
+}
+
--- udev-025/klibc/klibc/include/string.h.strnlen 2004-06-02 15:26:45.185494440 +0200
+++ udev-025/klibc/klibc/include/string.h 2004-06-02 15:27:06.987180080 +0200
@@ -27,6 +27,7 @@
__extern char *strndup(const char *, size_t);
__extern char *strerror(int);
__extern size_t strlen(const char *);
+__extern size_t strnlen(const char *, size_t);
__extern char *strncat(char *, const char *, size_t);
__extern int strncmp(const char *, const char *, size_t);
__extern char *strncpy(char *, const char *, size_t);
next reply other threads:[~2004-07-15 9:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-15 9:07 Harald Hoyer [this message]
2004-07-15 16:39 ` strnlen for klibc H. Peter Anvin
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=40F64968.3000907@redhat.com \
--to=harald@redhat.com \
--cc=linux-hotplug@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).