Ver código fonte

Avoid to access past length of string in last commit

git-svn-id: trunk@38417 -
pierre 7 anos atrás
pai
commit
554c0c5a2a
1 arquivos alterados com 2 adições e 2 exclusões
  1. 2 2
      compiler/utils/msg2inc.pp

+ 2 - 2
compiler/utils/msg2inc.pp

@@ -102,7 +102,7 @@ begin
       begin
         if s=']' then
          multiline:=false
-        else if (s[1] <> '#') then
+        else if (s='') or (s[1] <> '#') then
          inc(msgsize,length(s)+1); { +1 for linebreak }
       end
      else
@@ -191,7 +191,7 @@ begin
            ptxt^:=#0;
            inc(ptxt);
          end
-        else if (s[1] <> '#') then
+        else if (s='') or (s[1] <> '#') then
          begin
            move(s[1],ptxt^,length(s));
            inc(ptxt,length(s));