Skip to content

Commit

Permalink
Check lengths of strings
Browse files Browse the repository at this point in the history
Signed-off-by: Igor S. Gerasimov <[email protected]>
  • Loading branch information
foxtran committed Feb 10, 2025
1 parent e127f1d commit 1ce07ea
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/mctc/symbols.f90
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,10 @@ pure subroutine appendSymbol(list, nList, symbol)
!> Elements symbol
character(len=*), intent(in) :: symbol

if (len(symbol) > len(list)) then
error stop "Programmer's bug: len(symbol) > len(list)"
end if

if (nList >= size(list)) then
call resize(list)
end if
Expand Down

0 comments on commit 1ce07ea

Please sign in to comment.