diff options
author | Alejandro Colomar <alx@kernel.org> | 2022-12-06 02:16:50 +0100 |
---|---|---|
committer | Alejandro Colomar <alx@kernel.org> | 2022-12-06 02:16:51 +0100 |
commit | 53854a54ac2a011f66ce4da2c22115e7a0a5ed5e (patch) | |
tree | 9fe8e1a35aa4738ae86ec80684584c203349919a | |
parent | 9baab44e7d2d930a1a69e39ef697ab56e43ef176 (diff) |
string.3: strncpy(3), strncat(3): Obsolete, and fix
The prototype for strncat(3) was wrong. Fix it.
Mark the functions as obsolete.
Fix the descriptions, to remove misleading text.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rw-r--r-- | man3/string.3 | 57 |
1 files changed, 29 insertions, 28 deletions
diff --git a/man3/string.3 b/man3/string.3 index 32e9d8f5a..46ab10923 100644 --- a/man3/string.3 +++ b/man3/string.3 @@ -113,20 +113,6 @@ Randomly swap the characters in Return the length of the string .IR s . .TP -.nf -.BI "char *strncat(char " dest "[restrict ." n "], \ -const char " src "[restrict ." n ], -.BI " size_t " n ); -.fi -Append at most -.I n -bytes from the string -.I src -to the string -.IR dest , -returning a pointer to -.IR dest . -.TP .BI "int strncmp(const char " s1 [. n "], const char " s2 [. n "], size_t " n ); Compare at most .I n @@ -135,20 +121,6 @@ bytes of the strings and .IR s2 . .TP -.nf -.BI "char *strncpy(char " dest "[restrict ." n "], \ -const char " src "[restrict ." n ], -.BI " size_t " n ); -.fi -Copy at most -.I n -bytes from string -.I src -to -.IR dest , -returning a pointer to the start of -.IR dest . -.TP .BI "char *strpbrk(const char *" s ", const char *" accept ); Return a pointer to the first occurrence in the string .I s @@ -197,6 +169,35 @@ to the current locale and copies the first .I n bytes to .IR dst . +.SS Obsolete functions +.TP +.nf +.BI "char *strncpy(char " dest "[restrict ." n "], \ +const char " src "[restrict ." n ], +.BI " size_t " n ); +.fi +Copy at most +.I n +bytes from string +.I src +to +.IR dest , +returning a pointer to the start of +.IR dest . +.TP +.nf +.BI "char *strncat(char " dest "[restrict strlen(." dest ") + strnlen(." src ") + 1]," +.BI " const char " src "[restrict ." n ], +.BI " size_t " n ); +.fi +Append at most +.I n +bytes from +.I src +to +.IR dest , +returning a pointer to +.IR dest . .SH DESCRIPTION The string functions perform operations on null-terminated strings. |