Scope-eye.net Git Repository
/
liskon_frotz.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3b39e44
)
malloc size fix
author
borg323
<4010067-borg323@users.noreply.gitlab.com>
Mon, 20 May 2019 18:25:03 +0000
(21:25 +0300)
committer
David Griffith
<dave@661.org>
Mon, 27 May 2019 02:32:11 +0000
(19:32 -0700)
src/curses/ux_input.c
patch
|
blob
|
history
diff --git
a/src/curses/ux_input.c
b/src/curses/ux_input.c
index 02908ffacc80903faf5c172bfef02ef819e7cd0e..60e861a93b67fb3a4327171ab35d22697e34cf00 100644
(file)
--- a/
src/curses/ux_input.c
+++ b/
src/curses/ux_input.c
@@
-390,7
+390,7
@@
static void unix_add_to_history(zchar *str)
if (*history_next != NULL)
free( *history_next);
- *history_next = (zchar *)malloc(
zwordstrlen(str) + 1
);
+ *history_next = (zchar *)malloc(
(zwordstrlen(str) + 1) * sizeof(zchar)
);
zwordstrncpy( *history_next, str, zwordstrlen(str) + 1);
RING_INC( history_next, history_buffer, history_end);
history_view = history_next; /* Reset user frame after each line */