diff options
Diffstat (limited to 'src/strings.cpp')
-rw-r--r-- | src/strings.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/strings.cpp b/src/strings.cpp index 82669ddb2..e1e352f5d 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -449,6 +449,8 @@ static char *FormatGenericCurrency(char *buff, const CurrencySpec *spec, Money n /* convert from negative */ if (number < 0) { + if (buff + Utf8CharLen(SCC_PUSH_COLOUR) > last) return buff; + buff += Utf8Encode(buff, SCC_PUSH_COLOUR); if (buff + Utf8CharLen(SCC_RED) > last) return buff; buff += Utf8Encode(buff, SCC_RED); buff = strecpy(buff, "-", last); @@ -485,8 +487,8 @@ static char *FormatGenericCurrency(char *buff, const CurrencySpec *spec, Money n if (spec->symbol_pos != 0) buff = strecpy(buff, spec->suffix, last); if (negative) { - if (buff + Utf8CharLen(SCC_PREVIOUS_COLOUR) > last) return buff; - buff += Utf8Encode(buff, SCC_PREVIOUS_COLOUR); + if (buff + Utf8CharLen(SCC_POP_COLOUR) > last) return buff; + buff += Utf8Encode(buff, SCC_POP_COLOUR); *buff = '\0'; } |