Skip to content

Commit fb910d1

Browse files
committed
brace initialize array
1 parent a1b1b66 commit fb910d1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

flang/runtime/extensions.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#define LOGIN_NAME_MAX UNLEN
3030

3131
inline int getlogin_r(char *buf, size_t bufSize) {
32-
wchar_t w_username[UNLEN + 1];
32+
wchar_t w_username[UNLEN + 1] = {};
3333
DWORD nameLen = UNLEN + 1;
3434

3535
if (GetUserName(w_username, &nameLen)) {
@@ -82,7 +82,7 @@ void FORTRAN_PROCEDURE_NAME(getarg)(
8282
}
8383

8484
void FORTRAN_PROCEDURE_NAME(getlog)(std::int8_t *arg, std::int64_t length) {
85-
std::array<char, LOGIN_NAME_MAX + 1> str;
85+
std::array<char, LOGIN_NAME_MAX + 1> str = {};
8686

8787
int error = getlogin_r(str.data(), str.size());
8888
Terminator terminator{__FILE__, __LINE__};

0 commit comments

Comments
 (0)