Skip to content

Commit bcba0e1

Browse files
committed
fix version_t bug
1 parent 8023c53 commit bcba0e1

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

src/fpm/versioning.f90

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -227,15 +227,17 @@ pure function s(self) result(string)
227227
character(len=buffersize) :: buffer
228228
integer :: ii
229229

230-
do ii = 1, size(self%num)
231-
if (allocated(string)) then
232-
write(buffer, '(".", i0)') self%num(ii)
233-
string = string // trim(buffer)
234-
else
235-
write(buffer, '(i0)') self%num(ii)
236-
string = trim(buffer)
237-
end if
238-
end do
230+
if (allocated(self%num)) then
231+
do ii = 1, size(self%num)
232+
if (allocated(string)) then
233+
write(buffer, '(".", i0)') self%num(ii)
234+
string = string // trim(buffer)
235+
else
236+
write(buffer, '(i0)') self%num(ii)
237+
string = trim(buffer)
238+
end if
239+
end do
240+
endif
239241

240242
if (.not.allocated(string)) then
241243
string = '0'

0 commit comments

Comments
 (0)