diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/sgr.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -61,7 +61,15 @@ sgr(char *param, png_colorp fg, png_colorp bg) end = 1; } *param = '\0'; - i = atoi(p); + if (*p) { + i = atoi(p); + } else { + i = 0; + } + if (i == 0) { /* Reset */ + memcpy(fg, &_4bit[7], sizeof(*fg)); + memcpy(bg, &_4bit[0], sizeof(*bg)); + } if (i >= 30 && i <= 37) { /* Set foreground color */ memcpy(fg, &_4bit[i - 30], sizeof(*fg)); } |