diff options
author | Mark Wong <mark@2ndQuadrant.com> | 2020-04-16 08:21:32 -0700 |
---|---|---|
committer | Mark Wong <mark@2ndQuadrant.com> | 2020-04-16 08:21:32 -0700 |
commit | b86878d47bc5157558d1a10fde576ce77767f11e (patch) | |
tree | 98329bdfe888688de1b1707f271d4a9754b2a4ad | |
parent | 4c5f868ab85d18ffd692dbadfd45f277a54f8f3c (diff) |
Add extra error handling to i_process()
-rw-r--r-- | display.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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); |