summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTodd A. Pratt <toddpratt978@gmail.com>2016-01-30 11:32:08 -0500
committerTodd A. Pratt <toddpratt978@gmail.com>2016-01-30 11:32:08 -0500
commit966d002b55eb0b49a04833e5a51b9ab265013eab (patch)
treed8d17459163d7acbfbdc8679f94c8276476413a7 /src
parent876609901a5476ab2764a8002b9c57d25dc34f20 (diff)
downloadirssi-966d002b55eb0b49a04833e5a51b9ab265013eab.zip
remove memory allocation check, spaces to tabs
Diffstat (limited to 'src')
-rw-r--r--src/fe-text/gui-entry.c44
1 files changed, 20 insertions, 24 deletions
diff --git a/src/fe-text/gui-entry.c b/src/fe-text/gui-entry.c
index 58743ac3..78b9166d 100644
--- a/src/fe-text/gui-entry.c
+++ b/src/fe-text/gui-entry.c
@@ -589,32 +589,28 @@ void gui_entry_erase(GUI_ENTRY_REC *entry, int size, CUTBUFFER_UPDATE_OP update_
unichar *tmpcutbuffer = entry->cutbuffer;
switch (update_cutbuffer) {
case CUTBUFFER_UPDATE_APPEND:
- entry->cutbuffer = g_new(unichar, cutbuffer_new_size+1);
- if (entry->cutbuffer) {
- memcpy(entry->cutbuffer, tmpcutbuffer,
- entry->cutbuffer_len * sizeof(unichar));
- memcpy(entry->cutbuffer + entry->cutbuffer_len * sizeof(unichar),
- entry->text + entry->pos - size, size * sizeof(unichar));
-
- entry->cutbuffer_len = cutbuffer_new_size;
- entry->cutbuffer[cutbuffer_new_size] = '\0';
- g_free(tmpcutbuffer);
- }
- break;
+ entry->cutbuffer = g_new(unichar, cutbuffer_new_size+1);
+ memcpy(entry->cutbuffer, tmpcutbuffer,
+ entry->cutbuffer_len * sizeof(unichar));
+ memcpy(entry->cutbuffer + entry->cutbuffer_len * sizeof(unichar),
+ entry->text + entry->pos - size, size * sizeof(unichar));
+
+ entry->cutbuffer_len = cutbuffer_new_size;
+ entry->cutbuffer[cutbuffer_new_size] = '\0';
+ g_free(tmpcutbuffer);
+ break;
case CUTBUFFER_UPDATE_PREPEND:
- entry->cutbuffer = g_new(unichar, cutbuffer_new_size+1);
- if (entry->cutbuffer) {
- memcpy(entry->cutbuffer, entry->text + entry->pos - size,
- size * sizeof(unichar));
- memcpy(entry->cutbuffer + size, tmpcutbuffer,
- entry->cutbuffer_len * sizeof(unichar));
-
- entry->cutbuffer_len = cutbuffer_new_size;
- entry->cutbuffer[cutbuffer_new_size] = '\0';
- g_free(tmpcutbuffer);
- }
- break;
+ entry->cutbuffer = g_new(unichar, cutbuffer_new_size+1);
+ memcpy(entry->cutbuffer, entry->text + entry->pos - size,
+ size * sizeof(unichar));
+ memcpy(entry->cutbuffer + size, tmpcutbuffer,
+ entry->cutbuffer_len * sizeof(unichar));
+
+ entry->cutbuffer_len = cutbuffer_new_size;
+ entry->cutbuffer[cutbuffer_new_size] = '\0';
+ g_free(tmpcutbuffer);
+ break;
case CUTBUFFER_UPDATE_REPLACE:
/* put erased text to cutbuffer */