Safe lower bound for string check, or it may crash in phonon (phq_readin, line 488) if fildyn is too short

git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@8595 c92efa57-630b-4861-b058-cf58834340f0
This commit is contained in:
paulatto 2012-02-09 11:30:40 +00:00
parent 7046a190ea
commit e8df497cbc
1 changed files with 3 additions and 2 deletions

View File

@ -14,13 +14,14 @@ IMPLICIT NONE
CHARACTER(LEN=*), INTENT(INOUT) :: inp_string
INTEGER :: leng
INTEGER :: leng, start
CHARACTER(LEN=4) :: aux
LOGICAL, EXTERNAL :: matches
has_xml=.FALSE.
leng=LEN_TRIM(inp_string)
aux=inp_string(leng-3:leng)
start=MAX(leng-3,1)
aux=inp_string(start:leng)
IF (matches(aux,'.xml').OR.matches(aux,'.XML')) THEN
has_xml=.TRUE.