Skip to content

Commit bc14da6

Browse files
committed
Zero-fill the embedded file
1 parent 74bf395 commit bc14da6

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Sources/_TestingInternals/Versions.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,11 @@ const char *swt_getTestingLibraryVersion(void) {
2828
#pragma clang diagnostic pop
2929
};
3030

31-
// Trim any trailing whitespace.
31+
// Zero any trailing characters (e.g. the copyright block.)
3232
static std::once_flag once;
3333
std::call_once(once, [] {
3434
auto i = std::find_if(std::begin(version), std::end(version), isspace);
35-
if (i != std::end(version)) {
36-
*i = '\0';
37-
}
35+
std::fill(i, std::end(version), '\0');
3836
});
3937

4038
return version;

0 commit comments

Comments
 (0)