1
0
mirror of https://github.com/irssi/irssi.git synced 2024-09-08 04:26:01 -04:00

Merge pull request #478 from pisculichi/fix-ansic-issues

Fix some ANSI-C issues
This commit is contained in:
ailin-nemui 2016-05-03 20:58:23 +02:00
commit 1cfec5f63d
6 changed files with 15 additions and 9 deletions

View File

@ -175,6 +175,7 @@ static void sig_message_public(SERVER_REC *server, const char *msg,
int for_me, print_channel, level;
char *nickmode, *color, *freemsg = NULL;
HILIGHT_REC *hilight;
TEXT_DEST_REC dest;
/* NOTE: this may return NULL if some channel is just closed with
/WINDOW CLOSE and server still sends the few last messages */
@ -214,7 +215,6 @@ static void sig_message_public(SERVER_REC *server, const char *msg,
if (printnick == NULL)
printnick = nick;
TEXT_DEST_REC dest;
format_create_dest(&dest, server, target, level, NULL);
dest.address = address;
dest.nick = nick;
@ -396,8 +396,9 @@ static void sig_message_quit(SERVER_REC *server, const char *nick,
count = 0; windows = NULL;
chans = g_string_new(NULL);
for (tmp = server->channels; tmp != NULL; tmp = tmp->next) {
CHANNEL_REC *rec;
level = MSGLEVEL_QUITS;
CHANNEL_REC *rec = tmp->data;
rec = tmp->data;
if (!nicklist_find(rec, nick))
continue;

View File

@ -365,9 +365,9 @@ char *theme_format_expand_get(THEME_REC *theme, const char **format)
GString *str;
char *ret;
theme_rm_col dummy, reset;
int braces = 1; /* we start with one brace opened */
dummy.m[0] = '\0';
strcpy(reset.m, "n");
int braces = 1; /* we start with one brace opened */
str = g_string_new(NULL);
while (**format != '\0' && braces != 0) {

View File

@ -554,6 +554,7 @@ void gui_entry_insert_char(GUI_ENTRY_REC *entry, unichar chr)
char *gui_entry_get_cutbuffer(GUI_ENTRY_REC *entry)
{
GUI_ENTRY_CUTBUFFER_REC *tmp;
char *buf;
int i;
@ -562,7 +563,7 @@ char *gui_entry_get_cutbuffer(GUI_ENTRY_REC *entry)
if (entry->kill_ring == NULL || entry->kill_ring->data == NULL)
return NULL;
GUI_ENTRY_CUTBUFFER_REC *tmp = entry->kill_ring->data;
tmp = entry->kill_ring->data;
if (tmp->cutbuffer == NULL)
return NULL;
@ -582,12 +583,14 @@ char *gui_entry_get_cutbuffer(GUI_ENTRY_REC *entry)
char *gui_entry_get_next_cutbuffer(GUI_ENTRY_REC *entry)
{
GUI_ENTRY_CUTBUFFER_REC *tmp;
g_return_val_if_fail(entry != NULL, NULL);
if (entry->kill_ring == NULL)
return NULL;
GUI_ENTRY_CUTBUFFER_REC *tmp = entry->kill_ring->data;
tmp = entry->kill_ring->data;
entry->kill_ring = g_slist_remove(entry->kill_ring, tmp);
entry->kill_ring = g_slist_append(entry->kill_ring, tmp);
@ -608,7 +611,7 @@ void gui_entry_erase_to(GUI_ENTRY_REC *entry, int pos, CUTBUFFER_UPDATE_OP updat
static GUI_ENTRY_CUTBUFFER_REC *get_cutbuffer_rec(GUI_ENTRY_REC *entry, CUTBUFFER_UPDATE_OP update_cutbuffer)
{
GUI_ENTRY_CUTBUFFER_REC *tmp = NULL;
GUI_ENTRY_CUTBUFFER_REC *tmp;
g_return_val_if_fail(entry != NULL, NULL);

View File

@ -696,10 +696,11 @@ static void key_append_next_kill(void)
static gboolean paste_timeout(gpointer data)
{
int split_lines;
paste_was_bracketed_mode = paste_bracketed_mode;
/* number of lines after splitting extra-long messages */
int split_lines = paste_buffer->len / LINE_SPLIT_LIMIT;
split_lines = paste_buffer->len / LINE_SPLIT_LIMIT;
/* Take into account the fact that a line may be split every LINE_SPLIT_LIMIT characters */
if (paste_line_count == 0 && split_lines <= paste_verify_line_count) {

View File

@ -671,8 +671,8 @@ void statusbar_item_default_handler(SBAR_ITEM_REC *item, int get_size_only,
WI_ITEM_REC *wiitem;
char *tmpstr, *tmpstr2;
theme_rm_col reset;
strcpy(reset.m, "n");
int len;
strcpy(reset.m, "n");
if (str == NULL)
str = statusbar_item_get_value(item);

View File

@ -28,13 +28,14 @@
/* SYNTAX: IRSSIPROXY STATUS */
static void cmd_irssiproxy_status(const char *data, IRC_SERVER_REC *server)
{
GSList *tmp;
if (!settings_get_bool("irssiproxy")) {
printtext(server, NULL, MSGLEVEL_CLIENTNOTICE,
"Proxy is currently disabled");
return;
}
GSList *tmp;
printtext(server, NULL, MSGLEVEL_CLIENTNOTICE,
"Proxy: Currently connected clients: %d",