Prevent undefined behavior in readFlagString when the string is empty.