diff --git a/lib/libc/string/strsep.3 b/lib/libc/string/strsep.3 index 4e9dad9db5ae..3013fb3b313e 100644 --- a/lib/libc/string/strsep.3 +++ b/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 @@ to parse a string, and prints each token in separate line: char *token, *string, *tofree; tofree = string = strdup("abc,def,ghi"); -assert(string != NULL); - -while ((token = strsep(&string, ",")) != NULL) - printf("%s\en", token); +if (string != NULL) + while ((token = strsep(&string, ",")) != NULL) + printf("%s\en", token); free(tofree); +free(string); .Ed .Pp The following uses