diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2014-01-12 13:33:35 -0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2014-01-12 13:33:35 -0800 |
commit | 89069fdaa4fff2f8b703fef0be260eb4d4c2ed9b (patch) | |
tree | 89d1d66d214ae3f149c8e152b1fd7cd204395670 /builtin_commandline.cpp | |
parent | 1130e4782de6378a7ad2cbb39cfb1626d7233fe8 (diff) |
Miscellaneous minor fixes based on cppcheck static analyzer
Diffstat (limited to 'builtin_commandline.cpp')
-rw-r--r-- | builtin_commandline.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/builtin_commandline.cpp b/builtin_commandline.cpp index f6dc2b03..f121cb64 100644 --- a/builtin_commandline.cpp +++ b/builtin_commandline.cpp @@ -143,17 +143,13 @@ static void write_part(const wchar_t *begin, int cut_at_cursor, int tokenize) { - wcstring out; - wchar_t *buff; - size_t pos; - - pos = get_cursor_pos()-(begin-get_buffer()); + size_t pos = get_cursor_pos()-(begin-get_buffer()); if (tokenize) { - buff = wcsndup(begin, end-begin); + wchar_t *buff = wcsndup(begin, end-begin); // fwprintf( stderr, L"Subshell: %ls, end char %lc\n", buff, *end ); - out.clear(); + wcstring out; tokenizer_t tok(buff, TOK_ACCEPT_UNFINISHED); for (; tok_has_next(&tok); tok_next(&tok)) { |