Skip to content

Commit

Permalink
noping: dynamic graph padding
Browse files Browse the repository at this point in the history
  • Loading branch information
l29ah committed Nov 24, 2015
1 parent 7997ae2 commit b3bb469
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/oping.c
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,7 @@ static int update_graph_boxplot (ping_context_t *ctx, int graph_x, int graph_y)
x_max = (size_t) getmaxx (ctx->window);
if (x_max <= 8)
return (EINVAL);
x_max -= 4;
x_max -= 2 * graph_x;

counters = calloc (x_max, sizeof (*counters));
ratios = calloc (x_max, sizeof (*ratios));
Expand Down Expand Up @@ -1001,7 +1001,7 @@ static int update_graph_prettyping (ping_context_t *ctx, /* {{{ */
x_max = (size_t) getmaxx (ctx->window);
if (x_max <= 4)
return (EINVAL);
x_max -= 4;
x_max -= 2 * graph_x;

/* Determine the first index in the history we need to draw
* the graph. */
Expand Down Expand Up @@ -1127,7 +1127,7 @@ static int update_graph_histogram (ping_context_t *ctx, int graph_x, int graph_y
x_max = (size_t) getmaxx (ctx->window);
if (x_max <= 4)
return (EINVAL);
x_max -= 4;
x_max -= 2 * graph_x;

counters = calloc (x_max, sizeof (*counters));
accumulated = calloc (x_max, sizeof (*accumulated));
Expand Down

0 comments on commit b3bb469

Please sign in to comment.