Skip to content

Commit 5d7e177

Browse files
committed
Fix iomsg allocation
1 parent e7f423a commit 5d7e177

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/stdlib_io_npy_save.fypp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,9 @@ contains
128128
end if
129129

130130
if (present(iomsg)) then
131-
iomsg = "Failed to write array to file '"//filename//"'"
131+
if (stat /= 0) then
132+
iomsg = "Failed to write array to file '"//filename//"'"
133+
end if
132134
end if
133135
end subroutine save_npy_${t1[0]}$${k1}$_${rank}$
134136
#:endfor

0 commit comments

Comments
 (0)