2 strncpy - copy a number of chracters from head or all of a stringr
3 to head or all of a string
16 Let n1 = size(s1), n2 = size(n2), and m = min(n1, n2, n).
17 This function replaces the first m characters of s1 by the first
18 m characters of s2, and if min(n1, n) > n2, replaces the next
19 min(n1,n) - n2 characters of s1 by '\0'. The size of s1 and any
20 later characters of s1 are unchanged. The function returns s1, with
24 strncpy("abcdef", "xyz", 0) == "abcdef"
25 strncpy("abcdef", "xyz", 1) == "xbcdef"
26 strncpy("abcdef", "xyz", 2) == "xycdef"
27 strncpy("abcdef", "xyz", 3) == "xyzdef"
28 strncpy("abcdef", "xyz", 4) == "xyz\0ef"
29 strncpy("abcdef", "xyz", 5) == "xyz\0\0f"
30 strncpy("ab", "xyz", 3) == "xy"
36 STRING* stringncpy(STRING *s1, STRING *s2, long num)
39 strcat, strcpy, strerror, strlen, strncmp, strpos,
40 strprintf, strscan, strscanf, substr
42 ## Copyright (C) 2006 Ernest Bowen
44 ## Calc is open software; you can redistribute it and/or modify it under
45 ## the terms of the version 2.1 of the GNU Lesser General Public License
46 ## as published by the Free Software Foundation.
48 ## Calc is distributed in the hope that it will be useful, but WITHOUT
49 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
50 ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
51 ## Public License for more details.
53 ## A copy of version 2.1 of the GNU Lesser General Public License is
54 ## distributed with calc under the filename COPYING-LGPL. You should have
55 ## received a copy with calc; if not, write to Free Software Foundation, Inc.
56 ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
58 ## @(#) $Revision: 30.3 $
59 ## @(#) $Id: strncpy,v 30.3 2013/08/11 01:16:03 chongo Exp $
60 ## @(#) $Source: /usr/local/src/bin/calc/help/RCS/strncpy,v $
62 ## Under source code control: 2006/03/03 03:32:44
63 ## File existed as early as: 2006
65 ## chongo <was here> /\oo/\ http://www.isthe.com/chongo/
66 ## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/