projects
/
mit-scheme.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
44a22f4
)
microcode/option.c (string_copy_limited): Null-terminate result.
author
Matt Birkholz
<matt@birchwood-abbey.net>
Tue, 8 Mar 2016 18:34:15 +0000
(11:34 -0700)
committer
Matt Birkholz
<matt@birchwood-abbey.net>
Tue, 8 Mar 2016 18:34:15 +0000
(11:34 -0700)
src/microcode/option.c
patch
|
blob
|
history
diff --git
a/src/microcode/option.c
b/src/microcode/option.c
index 7cee60bef32249eb3fdfa59e4e5e26d0d7bc933b..021f6ba803149801b2135bffc8356365c1503553 100644
(file)
--- a/
src/microcode/option.c
+++ b/
src/microcode/option.c
@@
-302,6
+302,7
@@
string_copy_limited (const char * s, const char * e)
unsigned int n_chars = (e - s);
char * result = (OS_malloc (n_chars + 1));
strncpy (result, s, n_chars);
+ result[n_chars] = '\0';
return (result);
}
\f