lib/: Use ATTR_STRING() on stpecpy() and strtcpy()

These functions consume a source string.  Document that.  There's no way
to mark that they also produce a string in dst, though.  That will be up
to the static analyzer to guess.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
Alejandro Colomar
2023-11-26 18:52:56 +01:00
committed by Iker Pedrosa
parent a61cf0068b
commit 93a5c47c2c
2 changed files with 8 additions and 0 deletions
+4
View File
@@ -17,12 +17,16 @@
#include <stddef.h>
#include <string.h>
#include "attr.h"
ATTR_STRING(3)
inline char *stpecpy(char *dst, char *end, const char *restrict src);
/*
* SYNOPSIS
* [[gnu::null_terminated_string_arg(3)]]
* char *_Nullable stpecpy(char *_Nullable dst, char end[0],
* const char *restrict src);
*