From 35f46bbc16cd9e448ae4e97078bca4fb2f7b86ea Mon Sep 17 00:00:00 2001 From: mysticbbs Date: Mon, 22 Apr 2013 13:35:06 -0400 Subject: [PATCH] strPadC fix --- mdl/m_strings.pas | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mdl/m_strings.pas b/mdl/m_strings.pas index d9c73cd..c7747d9 100644 --- a/mdl/m_strings.pas +++ b/mdl/m_strings.pas @@ -53,6 +53,13 @@ Var Space : Byte; Temp : Byte; Begin + If Length(Str) > Len Then Begin + Str[0] := Chr(Len); + Result := Str; + + Exit; + End; + Space := (Len - Length(Str)) DIV 2; Temp := Len - ((Space * 2) + Length(Str)); Result := strRep(Ch, Space) + Str + strRep(Ch, Space + Temp);