about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ui-ssdiff.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ui-ssdiff.c b/ui-ssdiff.c
index a3dd059..c456033 100644
--- a/ui-ssdiff.c
+++ b/ui-ssdiff.c
@@ -117,6 +117,7 @@ static char *replace_tabs(char *line)
 	int n_tabs = 0;
 	int i;
 	char *result;
+	int result_len;
 
 	if (linelen == 0) {
 		result = xmalloc(1);
@@ -128,13 +129,14 @@ static char *replace_tabs(char *line)
 		if (line[i] == '\t')
 			n_tabs += 1;
 	}
-	result = xmalloc(linelen + n_tabs * 8 + 1);
+	result_len = linelen + n_tabs * 8;
+	result = xmalloc(result_len + 1);
 	result[0] = '\0';
 
 	for (;;) {
 		cur_buf = strchr(prev_buf, '\t');
 		if (!cur_buf) {
-			strcat(result, prev_buf);
+			strncat(result, prev_buf, result_len);
 			break;
 		} else {
 			strncat(result, prev_buf, cur_buf - prev_buf);
-19 23:20:42 -0400'>2024-09-19Add photos from September 5June McEnroe 2024-09-15Add some more film stocks to the listJune McEnroe 2024-09-13Add photos from September 2June McEnroe 2024-09-13Add Fomapan 200 to films listJune McEnroe 2024-09-10Add August 29 picnic photosJune McEnroe 2024-09-08Apply some bold to trips renderingJune McEnroe 2024-09-08Render trips hopefully more efficientlyJune McEnroe 2024-09-08Allow removing bodies and lensesJune McEnroe 2024-09-08Limit body width so it looks less silly on desktopJune McEnroe 2024-09-07Handle no film being loadedJune McEnroe 2024-09-07Fancy up the text a littleJune McEnroe