diff options
author | Mark Wong <markwkm@gmail.com> | 2007-09-24 23:33:18 -0700 |
---|---|---|
committer | Mark Wong <markwkm@gmail.com> | 2007-09-24 23:33:18 -0700 |
commit | 09ef9913931fd81e443bc0083be0a937d61d58ad (patch) | |
tree | df302c643b07aa0fc401f7765d9b562cfe183b72 | |
parent | fe9f774dd55c1cbeebebb9a75992639d9739899f (diff) |
Re-commited changes so that ptop doesn't seg fault if the databasev3.6.1-pre5
server is not up.
-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); |