1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-12-29 08:29:52 +00:00

Init all FormattedParts strings fields to an empty string

Fixes issue #51.
This commit is contained in:
Andy McFadden 2019-10-06 14:38:49 -07:00
parent abc2df5c04
commit 710a8dc679
2 changed files with 5 additions and 2 deletions

View File

@ -366,7 +366,10 @@ namespace SourceGen {
// Private constructor -- create instances with factory methods.
private FormattedParts() { }
private FormattedParts() {
Offset = Addr = Bytes = Flags = Attr = Label = Opcode = Operand = Comment =
string.Empty;
}
/// <summary>
/// Clones the specified object.

View File

@ -502,7 +502,7 @@ namespace SourceGen {
bool suppressLabel = false;
if (LongLabelNewLine && (line.LineType == LineListGen.Line.Type.Code ||
line.LineType == LineListGen.Line.Type.Data)) {
int labelLen = string.IsNullOrEmpty(parts.Label) ? 0 : parts.Label.Length;
int labelLen = parts.Label.Length;
if (labelLen > maxLabelLen) {
// put on its own line
string lstr;