diff options
author | Kevin Ballard <kevin@sb.org> | 2014-09-25 18:20:03 -0700 |
---|---|---|
committer | Kevin Ballard <kevin@sb.org> | 2014-09-25 18:20:03 -0700 |
commit | 35595dbffdf413694b31da46129432ef345921af (patch) | |
tree | e78b379cf7854b1a8402f8da267e8f6d84450c6f /input.cpp | |
parent | cd4fa518b86ddfb3e946fa4dd69e9e32a58ef81e (diff) |
Make escape() return a wcstring
This avoids the potential for leaking the resulting string.
Diffstat (limited to 'input.cpp')
-rw-r--r-- | input.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -365,7 +365,7 @@ void input_mapping_add(const wchar_t *sequence, const wchar_t **commands, size_t CHECK(mode,); CHECK(sets_mode,); - // debug( 0, L"Add mapping from %ls to %ls in mode %ls", escape(sequence, 1), escape(command, 1 ), mode); + // debug( 0, L"Add mapping from %ls to %ls in mode %ls", escape(sequence, ESCAPE_ALL).c_str(), escape(command, ESCAPE_ALL).c_str(), mode); // remove existing mappings with this sequence const wcstring_list_t commands_vector(commands, commands + commands_len); @@ -629,7 +629,7 @@ static bool input_mapping_is_match(const input_mapping_t &m) wint_t c = 0; int j; - //debug(0, L"trying mapping %ls\n", escape(m.seq.c_str(), 1)); + //debug(0, L"trying mapping %ls\n", escape(m.seq.c_str(), ESCAPE_ALL).c_str()); const wchar_t *str = m.seq.c_str(); for (j=0; str[j] != L'\0'; j++) { @@ -644,7 +644,7 @@ static bool input_mapping_is_match(const input_mapping_t &m) if (str[j] == L'\0') { - //debug(0, L"matched mapping %ls (%ls)\n", escape(m.seq.c_str(), 1), m.command.c_str()); + //debug(0, L"matched mapping %ls (%ls)\n", escape(m.seq.c_str(), ESCAPE_ALL).c_str(), m.command.c_str()); /* We matched the entire sequence */ return true; } @@ -680,7 +680,7 @@ static void input_mapping_execute_matching_or_generic(bool allow_commands) { const input_mapping_t &m = mapping_list.at(i); - //debug(0, L"trying mapping (%ls,%ls,%ls)\n", escape(m.seq.c_str(), 1), + //debug(0, L"trying mapping (%ls,%ls,%ls)\n", escape(m.seq.c_str(), ESCAPE_ALL).c_str(), // m.mode.c_str(), m.sets_mode.c_str()); if (m.mode != bind_mode) |