mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-11 11:42:51 -08:00
Introduce function coerce_to_simple_string() to ensure that C functions get a null-terminated string
This commit is contained in:
parent
b55a0130bc
commit
da477db1ea
4 changed files with 21 additions and 8 deletions
|
|
@ -116,6 +116,13 @@ copy_simple_string(cl_object x)
|
|||
return(y);
|
||||
}
|
||||
|
||||
cl_object
|
||||
coerce_to_simple_string(cl_object x)
|
||||
{
|
||||
assert_type_string(x);
|
||||
return x->string.adjustable? copy_simple_string(x) : x;
|
||||
}
|
||||
|
||||
cl_object
|
||||
cl_string(cl_object x)
|
||||
{
|
||||
|
|
@ -220,7 +227,7 @@ string_eq(cl_object x, cl_object y)
|
|||
cl_index i, j;
|
||||
i = x->string.fillp;
|
||||
j = y->string.fillp;
|
||||
return (i == j && strncmp(x->string.self, y->string.self, i) == 0);
|
||||
return (i == j && memcmp(x->string.self, y->string.self, i) == 0);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue