kunit: string-stream: Don't create a fragment for empty strings
authorRichard Fitzgerald <rf@opensource.cirrus.com>
Mon, 28 Aug 2023 10:41:02 +0000 (11:41 +0100)
committerShuah Khan <skhan@linuxfoundation.org>
Mon, 18 Sep 2023 16:45:05 +0000 (10:45 -0600)
commit5c54c9ebb1f4758a4da7731a809148ff1a3a1844
tree4811f6f2c29fb757af05bd7deb2bbe064f929978
parentce9ecca0238b140b88f43859b211c9fdfd8e5b70
kunit: string-stream: Don't create a fragment for empty strings

If the result of the formatted string is an empty string just return
instead of creating an empty fragment.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Reviewed-by: Rae Moar <rmoar@google.com>
Reviewed-by: David Gow <davidgow@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
lib/kunit/string-stream.c