Skip to content

Commit

Permalink
untmpstring
Browse files Browse the repository at this point in the history
Signed-off-by: James Cherry <[email protected]>
  • Loading branch information
jjcherry56 committed Mar 13, 2023
1 parent 7fadb5f commit e7beb14
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions search/ReportPath.cc
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,8 @@ ReportPath::setDigits(int digits)
{
digits_ = digits;

if (plus_zero_) {
stringDelete(plus_zero_);
stringDelete(minus_zero_);
}
stringDelete(plus_zero_);
stringDelete(minus_zero_);
minus_zero_ = stringPrint("-%.*f", digits_, 0.0);
plus_zero_ = stringPrint("%.*f", digits_, 0.0);
}
Expand Down Expand Up @@ -3164,11 +3162,16 @@ ReportPath::reportField(float value,
reportFieldBlank(field, line);
else {
Unit *unit = field->unit();
const char *value_str = (unit)
? unit->asString(value, digits_)
if (unit) {
const char *value_str = unit->asString(value, digits_);
reportField(value_str, field, line);
}
else {
// fanout
: stringPrintTmp("%.0f", value);
reportField(value_str, field, line);
string value_str;
stringPrint(value_str, "%.0f", value);
reportField(value_str.c_str(), field, line);
}
}
}

Expand Down

0 comments on commit e7beb14

Please sign in to comment.