mirror of
https://github.com/cryb-to/cryb-to.git
synced 2024-12-22 04:21:08 +00:00
Improve comments for strlcat() and strlcpy().
This commit is contained in:
parent
d4ae7a43cb
commit
d80dc09f3c
2 changed files with 15 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
|||
/*-
|
||||
* Copyright (c) 2011-2014 Dag-Erling Smørgrav
|
||||
* Copyright (c) 2011-2017 Dag-Erling Smørgrav
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -33,7 +33,13 @@
|
|||
|
||||
#include <cryb/strlcat.h>
|
||||
|
||||
/* like strcat(3), but always NUL-terminates; returns strlen(src) */
|
||||
/*
|
||||
* Like strcat(3), but always NUL-terminates.
|
||||
*
|
||||
* Returns strlen(dst) + strlen(src), regardless of how much was copied,
|
||||
* if dst was properly terminated. Returns size + strlen(src) otherwise.
|
||||
*/
|
||||
|
||||
size_t
|
||||
cryb_strlcat(char *dst, const char *src, size_t size)
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*-
|
||||
* Copyright (c) 2011-2014 Dag-Erling Smørgrav
|
||||
* Copyright (c) 2011-2017 Dag-Erling Smørgrav
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -33,7 +33,12 @@
|
|||
|
||||
#include <cryb/strlcpy.h>
|
||||
|
||||
/* like strcpy(3), but always NUL-terminates; returns strlen(src) */
|
||||
/*
|
||||
* Like strcpy(3), but always NUL-terminates.
|
||||
*
|
||||
* Returns strlen(src), regardless of how much was copied.
|
||||
*/
|
||||
|
||||
size_t
|
||||
cryb_strlcpy(char *dst, const char *src, size_t size)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue