Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F106162538
D15594.id43059.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
661 B
Referenced Files
None
Subscribers
None
D15594.id43059.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D15594: Update strsetp(3) EXAMPLE section.
Attached
Detach File
Event Timeline
Log In to Comment