1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

remove memory allocation check, spaces to tabs

This commit is contained in:
Todd A. Pratt 2016-01-30 11:32:08 -05:00
parent 876609901a
commit 966d002b55

View File

@ -590,7 +590,6 @@ void gui_entry_erase(GUI_ENTRY_REC *entry, int size, CUTBUFFER_UPDATE_OP update_
switch (update_cutbuffer) { switch (update_cutbuffer) {
case CUTBUFFER_UPDATE_APPEND: case CUTBUFFER_UPDATE_APPEND:
entry->cutbuffer = g_new(unichar, cutbuffer_new_size+1); entry->cutbuffer = g_new(unichar, cutbuffer_new_size+1);
if (entry->cutbuffer) {
memcpy(entry->cutbuffer, tmpcutbuffer, memcpy(entry->cutbuffer, tmpcutbuffer,
entry->cutbuffer_len * sizeof(unichar)); entry->cutbuffer_len * sizeof(unichar));
memcpy(entry->cutbuffer + entry->cutbuffer_len * sizeof(unichar), memcpy(entry->cutbuffer + entry->cutbuffer_len * sizeof(unichar),
@ -599,12 +598,10 @@ void gui_entry_erase(GUI_ENTRY_REC *entry, int size, CUTBUFFER_UPDATE_OP update_
entry->cutbuffer_len = cutbuffer_new_size; entry->cutbuffer_len = cutbuffer_new_size;
entry->cutbuffer[cutbuffer_new_size] = '\0'; entry->cutbuffer[cutbuffer_new_size] = '\0';
g_free(tmpcutbuffer); g_free(tmpcutbuffer);
}
break; break;
case CUTBUFFER_UPDATE_PREPEND: case CUTBUFFER_UPDATE_PREPEND:
entry->cutbuffer = g_new(unichar, cutbuffer_new_size+1); entry->cutbuffer = g_new(unichar, cutbuffer_new_size+1);
if (entry->cutbuffer) {
memcpy(entry->cutbuffer, entry->text + entry->pos - size, memcpy(entry->cutbuffer, entry->text + entry->pos - size,
size * sizeof(unichar)); size * sizeof(unichar));
memcpy(entry->cutbuffer + size, tmpcutbuffer, memcpy(entry->cutbuffer + size, tmpcutbuffer,
@ -613,7 +610,6 @@ void gui_entry_erase(GUI_ENTRY_REC *entry, int size, CUTBUFFER_UPDATE_OP update_
entry->cutbuffer_len = cutbuffer_new_size; entry->cutbuffer_len = cutbuffer_new_size;
entry->cutbuffer[cutbuffer_new_size] = '\0'; entry->cutbuffer[cutbuffer_new_size] = '\0';
g_free(tmpcutbuffer); g_free(tmpcutbuffer);
}
break; break;
case CUTBUFFER_UPDATE_REPLACE: case CUTBUFFER_UPDATE_REPLACE: