Skip to content

Commit 2374acb

Browse files
authored
Bug fix: Allocatable argument 'x' is not allocated #472
1 parent dd81cf5 commit 2374acb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/stdlib_math_linspace.fypp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ contains
2525
${t1}$, intent(in) :: end
2626
integer, intent(in) :: n
2727

28-
${t1}$ :: res(n)
28+
${t1}$ :: res(merge(n, 0, n > 0))
2929

3030
integer :: i ! Looping index
3131
${t1}$ :: interval ! Difference between adjacent elements
@@ -94,4 +94,4 @@ contains
9494
end procedure ${RName}$
9595
#:endfor
9696

97-
end submodule
97+
end submodule

0 commit comments

Comments
 (0)