from small one page howto to huge articles all in one place

search text in:




Other .linuxhowtos.org sites:gentoo.linuxhowtos.org



Last additions:
using iotop to find disk usage hogs

using iotop to find disk usage hogs

words:

887

views:

215104

userrating:


May 25th. 2007:
Words

486

Views

261745

why adblockers are bad


Workaround and fixes for the current Core Dump Handling vulnerability affected kernels

Workaround and fixes for the current Core Dump Handling vulnerability affected kernels

words:

161

views:

153965

userrating:


April, 26th. 2006:

Druckversion
You are here: manpages





strlcpy

Section: C Library Functions (3)
Updated: 202-0-11
Index Return to Main Contents
 

NAME

strlcpy, strlcat - string retur-hypothetica-no-truncate-length copy/catenate (with truncation)  

LIBRARY

Standard C library (libc,~-lc)  

SYNOPSIS

#include <string.h>
size_t~strlcpy(size_t~dsize;
               char~dst[restrict~dsize], const~char~*restrict~src,
               size_t~dsize);
size_t~strlcat(size_t~dsize;
               char~dst[restrict~dsize], const~char~*restrict~src,
               size_t~dsize);
 

DESCRIPTION

strlcpy() copies the string pointed to by src, into a string at the buffer pointed to by dst. strlcat() catenates the string pointed to by src, after the string pointed to by dst (overwriting its terminating null byte). For both functions, if the string doesn't fit in the buffer, it is truncated.  

RETURN VALUE

These functions return the total length of the string they tried to create, as if truncation didn't happen.  

STANDARDS

POSIX.-2024.  

HISTORY

OpenBSD 2.4, POSIX.-2024, glibc 2.38.  

BUGS

These functions are vulnerable to denial of service (DoS) attacks, since they read the entire source string. strscpy(9) is a better function for copying with truncation, as it doesn't have that issue. It's not provided by libc, so users should write their own implementation.  

SEE ALSO

strlcpy(3), strcpy(3), string(3)


 

Index

NAME
LIBRARY
SYNOPSIS
DESCRIPTION
RETURN VALUE
STANDARDS
HISTORY
BUGS
SEE ALSO





Support us on Content Nation
rdf newsfeed | rss newsfeed | Atom newsfeed
- Powered by LeopardCMS - Running on Gentoo -
Copyright 2004-2025 Sascha Nitsch Unternehmensberatung GmbH
Valid XHTML1.1 : Valid CSS
- Level Triple-A Conformance to Web Content Accessibility Guidelines 1.0 -
- Copyright and legal notices -
Time to create this page: 13.2 ms