copy word cursor: null terminate properly (off by one). - sob - simple output bar
(HTM) git clone git://git.codemadness.org/sob
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit bdbc1fb6cd9b3396216dce195cb939aeecb0a29e
(DIR) parent 0b974dd40e0a43e83656172f1af3067a438b86c4
(HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Sat, 25 Oct 2014 10:21:07 +0000
copy word cursor: null terminate properly (off by one).
Diffstat:
M sob.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
(DIR) diff --git a/sob.c b/sob.c
@@ -545,7 +545,7 @@ line_copywordcursor(char *buf, size_t bufsiz)
if(len + 1 > bufsiz)
len = bufsiz - 1;
memcpy(buf, &line.line[bs], len);
- buf[len + 1] = '\0';
+ buf[len] = '\0';
}
static int