Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107371062
D15594.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
676 B
Referenced Files
None
Subscribers
None
D15594.diff
View Options
Index: head/lib/libc/string/strsep.3
===================================================================
--- head/lib/libc/string/strsep.3
+++ head/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
Details
Attached
Mime Type
text/plain
Expires
Tue, Jan 14, 4:48 AM (20 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15791117
Default Alt Text
D15594.diff (676 B)
Attached To
Mode
D15594: Update strsetp(3) EXAMPLE section.
Attached
Detach File
Event Timeline
Log In to Comment