Rewrite add_string_to_logwindow()

Make static, fix formatting, shorten some variable names, use += to add
to variable, accept immutable strings.
master
Pavel Roskin 8 years ago
parent 77b380c0b5
commit 27ba5b4e86

@ -1857,22 +1857,21 @@ xrdp_wm_log_wnd_notify(struct xrdp_bitmap *wnd,
return 0; return 0;
} }
void add_string_to_logwindow(char *msg, struct list *log) static void
add_string_to_logwindow(const char *msg, struct list *log)
{ {
const char *new_part_message;
char *new_part_message; const char *current_pointer = msg;
char *current_pointer = msg ; int len_done = 0;
int processedlen = 0;
do do
{ {
new_part_message = g_strndup(current_pointer, LOG_WINDOW_CHAR_PER_LINE) ; new_part_message = g_strndup(current_pointer, LOG_WINDOW_CHAR_PER_LINE);
g_writeln("%s",new_part_message); g_writeln("%s", new_part_message);
list_add_item(log, (long)new_part_message); list_add_item(log, (tintptr) new_part_message);
processedlen = processedlen + g_strlen(new_part_message); len_done += g_strlen(new_part_message);
current_pointer = current_pointer + g_strlen(new_part_message) ; current_pointer += g_strlen(new_part_message);
} } while ((len_done < g_strlen(msg)) && (len_done < DEFAULT_STRING_LEN));
while ((processedlen < g_strlen(msg)) && (processedlen < DEFAULT_STRING_LEN));
} }
/*****************************************************************************/ /*****************************************************************************/

Loading…
Cancel
Save