summaryrefslogtreecommitdiff
path: root/buffer.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-03-02 23:05:47 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-03-02 23:05:47 -0500
commit31b4505161f19e7b94cdd224bd4a3049970a0988 (patch)
tree55336efb257da8178f78d1b0829dc03d699694e9 /buffer.c
parent5625bc523861cf16c1aade7a4e7e6f8731a24b6e (diff)
debugging
Diffstat (limited to 'buffer.c')
-rw-r--r--buffer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/buffer.c b/buffer.c
index bdba7ff..d1ccb11 100644
--- a/buffer.c
+++ b/buffer.c
@@ -578,7 +578,7 @@ static Status buffer_line_set_len(TextBuffer *buffer, Line *line, u32 new_len) {
line->str = new_str;
}
}
- } else if (line->len == 0 && new_len > 0) {
+ } else if (!line->str) {
// start by allocating 8 code points
line->str = buffer_malloc(buffer, 8 * sizeof *line->str);
if (!line->str) {
@@ -1811,7 +1811,7 @@ void buffer_copy_or_cut(TextBuffer *buffer, bool cut) {
int err = SDL_SetClipboardText(text);
free(text);
if (err < 0) {
- buffer_seterr(buffer, "Couldn't get clipboard contents: %s", SDL_GetError());
+ buffer_seterr(buffer, "Couldn't set clipboard contents: %s", SDL_GetError());
} else {
// text copied successfully
if (cut) {