There isn’t really enough information to go on here to say for sure what your problem is. “ProgramName” doesn’t “see” anything. What you use ProgramName with is more relevant (i.e. what some other function “sees” ProgramName as containing.
If the value of FW_Path contains a null character and if the function you pass ProgramName to is dealing with null terminated strings, then it will consider the value of the string to be terminated by that null char, regardless of the actual length of the string.
s := 'hat'#0; // < the null char is part of the string (in addition to the null char marking the END of the string
msg := 'That''s a nice ' + s + ' you are wearing';
ShowMessage('Length of message = ' + IntToStr(Length(msg)) + ' chars');