diff options
Diffstat (limited to 'display.c')
-rw-r--r-- | display.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -327,7 +327,7 @@ display_write(int x, int y, int newcolor, int eol, char *new) colorp = &colorbuf[lineindex(y) + x]; /* main loop */ - while ((ch = *new++) != '\0') + while (new != NULL && (ch = *new++) != '\0') { /* if either character or color are different, an update is needed */ /* but only when the screen is wide enough */ @@ -511,7 +511,7 @@ summary_format(int x, int y, int *numbers, char **names) /* if the last string has a separator on the end, it has to be written with care */ - if ((num = strlen(lastname)) > 1 && + if (lastname != NULL && (num = strlen(lastname)) > 1 && lastname[num-2] == ',' && lastname[num-1] == ' ') { display_fmt(-1, -1, 0, 1, "%.*s", num-2, lastname); |