Page MenuHomeFreeBSD

D15594.id43059.diff
No OneTemporary

D15594.id43059.diff

Index: lib/libc/string/strsep.3
===================================================================
--- lib/libc/string/strsep.3
+++ lib/libc/string/strsep.3
@@ -31,7 +31,7 @@
.\" @(#)strsep.3 8.1 (Berkeley) 6/9/93
.\" $FreeBSD$
.\"
-.Dd December 5, 2008
+.Dd May 28, 2018
.Dt STRSEP 3
.Os
.Sh NAME
@@ -86,12 +86,12 @@
char *token, *string, *tofree;
tofree = string = strdup("abc,def,ghi");
-assert(string != NULL);
+if (string != NULL)
+ while ((token = strsep(&string, ",")) != NULL)
+ printf("%s\en", token);
-while ((token = strsep(&string, ",")) != NULL)
- printf("%s\en", token);
-
free(tofree);
+free(string);
.Ed
.Pp
The following uses

File Metadata

Mime Type
text/plain
Expires
Fri, Dec 27, 10:19 AM (10 h, 6 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15613320
Default Alt Text
D15594.id43059.diff (661 B)

Event Timeline