summaryrefslogtreecommitdiff
path: root/src/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common.c')
-rw-r--r--src/common.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/common.c b/src/common.c
index 60c6c42..8423c17 100644
--- a/src/common.c
+++ b/src/common.c
@@ -42,5 +42,6 @@ void ellipt(char* buf, char* outbuf, int size) {
strncpy(outbuf, buf, (size/2)-3);
strcat(outbuf, "...");
// Copy in the back end
- strcpy(&outbuf[(size/2)], &buf[buflen - size/2]);
+ // NOTE: Extra +1 for rounding errors to prevent buffer overflows
+ strcpy(&outbuf[(size/2)], &buf[buflen - (size/2) +1]);
}

Generated by cgit