color_tools: protect short2rgb against values with leading zeroes

This commit is contained in:
David Strobach 2019-04-26 14:41:30 +02:00
parent 4f48345fa2
commit f24c7afa69
2 changed files with 26 additions and 0 deletions

23
news/fix-ansi-colors.rst Normal file
View file

@ -0,0 +1,23 @@
**Added:**
* <news item>
**Changed:**
* <news item>
**Deprecated:**
* <news item>
**Removed:**
* <news item>
**Fixed:**
* Fixed crash while converting ANSI color codes with leading zeroes
**Security:**
* <news item>

View file

@ -385,6 +385,9 @@ def RGB_TO_SHORT():
def short2rgb(short):
short = short.lstrip("0")
if short == "":
short = "0"
return SHORT_TO_RGB[short]