summaryrefslogtreecommitdiffstats
path: root/lib/libc/string/strxfrm.3
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1999-02-12 23:40:41 +0000
committerache <ache@FreeBSD.org>1999-02-12 23:40:41 +0000
commitfa61c225af56ef56610108e5006c1075d5448be5 (patch)
treec6ab601937fa59a915a0977fee0815fa1c22bfc3 /lib/libc/string/strxfrm.3
parent652b6fba3670328fd067d0e6e5ec6cfb5bd3e888 (diff)
downloadFreeBSD-src-fa61c225af56ef56610108e5006c1075d5448be5.zip
FreeBSD-src-fa61c225af56ef56610108e5006c1075d5448be5.tar.gz
fix wrong return result
fix n=0 case improve manpage
Diffstat (limited to 'lib/libc/string/strxfrm.3')
-rw-r--r--lib/libc/string/strxfrm.323
1 files changed, 19 insertions, 4 deletions
diff --git a/lib/libc/string/strxfrm.3 b/lib/libc/string/strxfrm.3
index 308f942..ebe6bd0 100644
--- a/lib/libc/string/strxfrm.3
+++ b/lib/libc/string/strxfrm.3
@@ -51,11 +51,21 @@ The
function transforms a null-terminated string pointed to by
.Fa src
according to the current locale collation if any,
-then copies not more than
-.Fa n-1
-characters of the resulting string into
+then copies the resulting string
+into
+.Fa dst .
+Not more than
+.Fa n
+characters are copied into
.Fa dst ,
-terminating it with a null character and then returns the resulting length.
+including the terminating null character added.
+If
+.Fa n
+is set to 0,
+.Fa dst
+is permitted to be a NULL pointer (it helps to determine an actual size needed
+for transformation).
+.Pp
Comparing two strings using
.Fn strcmp
after
@@ -63,6 +73,11 @@ after
is equal to comparing
two original strings with
.Fn strcoll .
+.Sh RETURN VALUES
+Upon successful completion,
+.Fn strxfrm
+returns the length of the transformed string not including
+the terminating null character.
.Sh BUGS
Sometimes the behavior of this function is unpredictable.
.Sh SEE ALSO
OpenPOWER on IntegriCloud