Skip to content

Commit 04f293d

Browse files
authored
Bug fix: Allocatable argument 'x' is not allocated #472
1 parent b66a7b3 commit 04f293d

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
@@ -65,8 +65,8 @@ contains
6565
#:set RName = rname("linspace_n", 1, t1, k1)
6666
module procedure ${RName}$
6767

68-
real(${k1}$) :: x(n) ! array of the real part of complex number
69-
real(${k1}$) :: y(n) ! array of the imaginary part of the complex number
68+
real(${k1}$) :: x(max(n, 0)) ! array of the real part of complex number
69+
real(${k1}$) :: y(max(n, 0)) ! array of the imaginary part of the complex number
7070

7171
x = linspace(start%re, end%re, n)
7272
y = linspace(start%im, end%im, n)

0 commit comments

Comments
 (0)