summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Wong <mark@2ndQuadrant.com>2020-04-16 08:21:32 -0700
committerMark Wong <mark@2ndQuadrant.com>2020-04-16 08:21:32 -0700
commitb86878d47bc5157558d1a10fde576ce77767f11e (patch)
tree98329bdfe888688de1b1707f271d4a9754b2a4ad
parent4c5f868ab85d18ffd692dbadfd45f277a54f8f3c (diff)
Add extra error handling to i_process()
-rw-r--r--display.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/display.c b/display.c
index d30ec1d..5091587 100644
--- a/display.c
+++ b/display.c
@@ -1286,8 +1286,12 @@ u_header(char *text)
void
i_process(int line, char *thisline)
{
+ if (thisline == NULL)
+ return;
+
/* truncate the line to conform to our current screen width */
- thisline[display_width] = '\0';
+ if (strlen(thisline) > display_width)
+ thisline[display_width] = '\0';
/* write the line out */
display_write(0, y_procs + line, 0, 1, thisline);