mirror of
https://github.com/cryb-to/cryb-to.git
synced 2024-11-25 07:07:11 +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.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -33,7 +33,13 @@
|
||||||
|
|
||||||
#include <cryb/strlcat.h>
|
#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
|
size_t
|
||||||
cryb_strlcat(char *dst, const char *src, size_t size)
|
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.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -33,7 +33,12 @@
|
||||||
|
|
||||||
#include <cryb/strlcpy.h>
|
#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
|
size_t
|
||||||
cryb_strlcpy(char *dst, const char *src, size_t size)
|
cryb_strlcpy(char *dst, const char *src, size_t size)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue