Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Jan 2000 09:50:54 -0500 (EST)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Yukihiro Nakai <nakai@FreeBSD.org>
Cc:        cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org
Subject:   RE: cvs commit: ports/games/xsoldier/patches patch-aa patch-ac p
Message-ID:  <200001221450.JAA09228@server.baldwin.cx>
In-Reply-To: <200001221119.DAA81695@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

On 22-Jan-00 Yukihiro Nakai wrote:
> nakai       2000/01/22 03:19:01 PST
> 
>   Modified files:
>     games/xsoldier/patches patch-aa patch-ac 
>     games/xsoldier/pkg   DESCR 
>   Log:
>   Fix the ports.
>   There is not 'strlcpy' function here or in system.
>   So I replaced to strncpy.
>   
>   Submitted by:       Tsuguru Kato <tkato@prontomail.ne.jp>

That depends on the age of the machine:

> uname -a
FreeBSD john.baldwin.cx 3.4-STABLE FreeBSD 3.4-STABLE #7: Sun Jan  2 13:21:29 EST 2000
     john@john.baldwin.cx:/usr/source/src/sys/compile/JOHN  i386

> man -k strlcpy
strlcpy(3), strlcat(3) - size-bounded string copying and concatenation

From http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libc/string/strlcpy.c
you can see that strlcpy(3) has been in the system since 3.3.  The following test
should identify when it is safe to use it:

#include <sys/param.h>
#if (__FreeBSD_version >= 330000 && __FreeBSD_version <= 400000) || __FreeBSD_version >= 400012
  <use strlcpy>
#else
  <use strncpy>
#endif

-- 

John Baldwin <jhb@FreeBSD.org> -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.cslab.vt.edu/~jobaldwi/pgpkey.asc
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200001221450.JAA09228>