diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2017-02-02 13:12:15 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2017-02-02 13:52:00 +0100 |
| commit | 3b07039fecbab82ecdefbdb2c064a839d506431a (patch) | |
| tree | 2ad22a5e2958e18eb5f6a09ccba3189a0a6053f0 /sam.c | |
| parent | 6db279e12d40b1fb3863ff645cf130d1bcf7384c (diff) | |
| download | vis-3b07039fecbab82ecdefbdb2c064a839d506431a.tar.gz vis-3b07039fecbab82ecdefbdb2c064a839d506431a.tar.xz | |
Slight code cleanups, use buffer API where appropriate
Diffstat (limited to 'sam.c')
| -rw-r--r-- | sam.c | 10 |
1 files changed, 3 insertions, 7 deletions
@@ -572,8 +572,7 @@ static char *parse_until(const char **s, const char *until, const char *escchars } } - if (buffer_length(&buf)) - buffer_append(&buf, "\0", 1); + buffer_terminate(&buf); return buffer_move(&buf); } @@ -643,8 +642,7 @@ static char *parse_cmdname(const char **s) { while (**s && !isspace((unsigned char)**s) && (!ispunct((unsigned char)**s) || **s == '-')) buffer_append(&buf, (*s)++, 1); - if (buffer_length(&buf)) - buffer_append(&buf, "\0", 1); + buffer_terminate(&buf); return buffer_move(&buf); } @@ -1627,9 +1625,7 @@ static bool cmd_pipeout(Vis *vis, Win *win, Command *cmd, const char *argv[], Cu if (vis->cancel_filter) vis_info_show(vis, "Command cancelled"); - else if (status == 0) - ; //vis_info_show(vis, "Command succeded"); - else + else if (status != 0) vis_info_show(vis, "Command failed %s", buffer_content0(&buferr)); buffer_release(&buferr); |
