diff --git a/common.cpp b/common.cpp index a600432b0..518625600 100644 --- a/common.cpp +++ b/common.cpp @@ -761,7 +761,7 @@ void debug_safe(int level, const char *msg, const char *param1, const char *para errno = errno_old; } -void format_long_safe(char buff[128], long val) +void format_long_safe(char buff[64], long val) { if (val == 0) { @@ -795,7 +795,7 @@ void format_long_safe(char buff[128], long val) } } -void format_long_safe(wchar_t buff[128], long val) +void format_long_safe(wchar_t buff[64], long val) { if (val == 0) { diff --git a/common.h b/common.h index 6cf75759f..86c5bc6c9 100644 --- a/common.h +++ b/common.h @@ -348,8 +348,8 @@ void format_size_safe(char buff[128], unsigned long long sz); void debug_safe(int level, const char *msg, const char *param1 = NULL, const char *param2 = NULL, const char *param3 = NULL, const char *param4 = NULL, const char *param5 = NULL, const char *param6 = NULL, const char *param7 = NULL, const char *param8 = NULL, const char *param9 = NULL, const char *param10 = NULL, const char *param11 = NULL, const char *param12 = NULL); /** Writes out a long safely */ -void format_long_safe(char buff[128], long val); -void format_long_safe(wchar_t buff[128], long val); +void format_long_safe(char buff[64], long val); +void format_long_safe(wchar_t buff[64], long val); template diff --git a/env_universal.cpp b/env_universal.cpp index a9e7462a6..ed7396f6a 100644 --- a/env_universal.cpp +++ b/env_universal.cpp @@ -426,8 +426,6 @@ void env_universal_barrier() void env_universal_set(const wcstring &name, const wcstring &value, bool exportv) { - message_t *msg; - if (!s_env_univeral_inited) return; @@ -439,7 +437,7 @@ void env_universal_set(const wcstring &name, const wcstring &value, bool exportv } else { - msg = create_message(exportv?SET_EXPORT:SET, + message_t *msg = create_message(exportv?SET_EXPORT:SET, name.c_str(), value.c_str()); @@ -459,7 +457,6 @@ int env_universal_remove(const wchar_t *name) { int res; - message_t *msg; if (!s_env_univeral_inited) return 1; @@ -476,7 +473,7 @@ int env_universal_remove(const wchar_t *name) } else { - msg= create_message(ERASE, name, 0); + message_t *msg = create_message(ERASE, name, 0); msg->count=1; env_universal_server.unsent.push(msg); env_universal_barrier(); diff --git a/event.cpp b/event.cpp index d2b219e7d..a6fab6205 100644 --- a/event.cpp +++ b/event.cpp @@ -568,9 +568,6 @@ static void event_fire_internal(const event_t &event) */ static void event_fire_delayed() { - - size_t i; - /* If is_event is one, we are running the event-handler non-recursively. @@ -582,7 +579,7 @@ static void event_fire_delayed() { event_list_t new_blocked; - for (i=0; icursor_pos; - this->autosuggestion = completion_apply_to_command_line(comp.completion.c_str(), comp.flags, this->search_string, &cursor, true /* append only */); + this->autosuggestion = completion_apply_to_command_line(comp.completion, comp.flags, this->search_string, &cursor, true /* append only */); return 1; } @@ -2200,7 +2200,6 @@ static void handle_token_history(int forward, int reset) */ if (data->history_search.go_backwards()) { - wcstring item = data->history_search.current_string(); data->token_history_buff = data->history_search.current_string(); } current_pos = data->token_history_buff.size(); @@ -3325,7 +3324,7 @@ const wchar_t *reader_readline(void) { //history_reset(); data->history_search.go_to_end(); - reader_set_buffer(data->search_buff.c_str(), data->search_buff.size()); + reader_set_buffer(data->search_buff, data->search_buff.size()); } else {