Skip to content

Commit

Permalink
long lines in history file were truncated when loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
olofhagsand committed May 10, 2019
1 parent 165cd63 commit 3e1737c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cligen_history.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ hist_add(cligen_handle h,
char *p = buf;
int len;

if (strlen(buf) >= cligen_buf_size(h))
if (cligen_buf_increase(h, strlen(buf)) < 0)
goto done;
while (*p == ' ' || *p == '\t' || *p == '\n')
p++;
if (*p) {
Expand Down Expand Up @@ -349,7 +352,6 @@ cligen_hist_file_load(cligen_handle h,
int ret;
unsigned char ch;
cbuf *cb = NULL;


if ((cb = cbuf_new()) == NULL)
goto done;
Expand Down

0 comments on commit 3e1737c

Please sign in to comment.