Commit 99fa7f removed watch crashing from having the null ANSI
sequence. However it just ignored that sequence instead of fixing it.
This change correctly checks buf (not undefined endptr) and sends
the reset attribute if found.
Closes: #12
* attributes to apply, but typically there are between 1 and 3.
*/
+ /* Special case of <ESC>[m */
+ if (buf[0] == '\0')
+ set_ansi_attribute(0);
for (endptr = numstart = buf; *endptr != '\0'; numstart = endptr + 1) {
set_ansi_attribute(strtol(numstart, &endptr, 10));