003 File Manager
Current Path:
/usr/src/contrib/file/src
usr
/
src
/
contrib
/
file
/
src
/
📁
..
📄
Makefile.am
(878 B)
📄
Makefile.in
(31.09 KB)
📄
apprentice.c
(73.89 KB)
📄
apptype.c
(4.42 KB)
📄
ascmagic.c
(10.21 KB)
📄
asctime_r.c
(415 B)
📄
asprintf.c
(1.77 KB)
📄
buffer.c
(2.53 KB)
📄
cdf.c
(41.26 KB)
📄
cdf.h
(11.44 KB)
📄
cdf_time.c
(4.38 KB)
📄
compress.c
(22.59 KB)
📄
ctime_r.c
(402 B)
📄
der.c
(10.93 KB)
📄
der.h
(1.46 KB)
📄
dprintf.c
(2.02 KB)
📄
elfclass.h
(3.07 KB)
📄
encoding.c
(19.13 KB)
📄
file.c
(16.25 KB)
📄
file.h
(19.8 KB)
📄
file_opts.h
(3.68 KB)
📄
fmtcheck.c
(5.4 KB)
📄
fsmagic.c
(11.01 KB)
📄
funcs.c
(16.86 KB)
📄
getline.c
(2.74 KB)
📄
getopt_long.c
(12.51 KB)
📄
gmtime_r.c
(436 B)
📄
is_csv.c
(4.41 KB)
📄
is_json.c
(9.47 KB)
📄
is_tar.c
(4.74 KB)
📄
localtime_r.c
(448 B)
📄
magic.c
(14.85 KB)
📄
magic.h.in
(5.64 KB)
📄
mygetopt.h
(2.63 KB)
📄
pread.c
(424 B)
📄
print.c
(7.54 KB)
📄
readcdf.c
(16.25 KB)
📄
readelf.c
(44.75 KB)
📄
readelf.h
(16.76 KB)
📄
seccomp.c
(6.95 KB)
📄
softmagic.c
(54.32 KB)
📄
strcasestr.c
(2.76 KB)
📄
strlcat.c
(1.71 KB)
📄
strlcpy.c
(1.6 KB)
📄
tar.h
(2.56 KB)
📄
vasprintf.c
(19.22 KB)
Editing: strlcpy.c
/* $OpenBSD: strlcpy.c,v 1.10 2005/08/08 08:05:37 espie Exp $ */ /* * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* OPENBSD ORIGINAL: lib/libc/string/strlcpy.c */ #include "file.h" #include <sys/types.h> #include <string.h> /* * Copy src to string dst of size siz. At most siz-1 characters * will be copied. Always NUL terminates (unless siz == 0). * Returns strlen(src); if retval >= siz, truncation occurred. */ size_t strlcpy(char *dst, const char *src, size_t siz) { char *d = dst; const char *s = src; size_t n = siz; /* Copy as many bytes as will fit */ if (n != 0 && --n != 0) { do { if ((*d++ = *s++) == 0) break; } while (--n != 0); } /* Not enough room in dst, add NUL and traverse rest of src */ if (n == 0) { if (siz != 0) *d = '\0'; /* NUL-terminate dst */ while (*s++) ; } return(s - src - 1); /* count does not include NUL */ }
Upload File
Create Folder