From owner-freebsd-questions Mon May 14 3:43:49 2001 Delivered-To: freebsd-questions@freebsd.org Received: from rhymer.cogsci.ed.ac.uk (rhymer.cogsci.ed.ac.uk [129.215.144.8]) by hub.freebsd.org (Postfix) with ESMTP id E0D0B37B424 for ; Mon, 14 May 2001 03:43:46 -0700 (PDT) (envelope-from richard@cogsci.ed.ac.uk) Received: (from richard@localhost) by rhymer.cogsci.ed.ac.uk (8.9.3/8.9.3) id LAA23882; Mon, 14 May 2001 11:43:09 +0100 (BST) Date: Mon, 14 May 2001 11:43:09 +0100 (BST) Message-Id: <200105141043.LAA23882@rhymer.cogsci.ed.ac.uk> From: Richard Tobin Subject: Re: function strnlen To: Kris Kennaway , Silvestre Malta In-Reply-To: Kris Kennaway's message of Mon, 14 May 2001 03:05:34 -0700 Organization: just say no Cc: freebsd-questions@FreeBSD.ORG Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > I have no idea what strnlen() could be.. It appears to be a GNU / Linux function. It does the obvious thing - returns the length of a length-limited but possibly not null-terminated string. Something like this (untested) should do: size_t strnlen(const char *s, size_t n) { size_t i; for(i=0; i