mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-15 13:52:16 -08:00
When creating a C-STRING, leave only as many characters as dictated by the fill pointer
This commit is contained in:
parent
e4da9b1816
commit
c5205fb67c
2 changed files with 8 additions and 2 deletions
|
|
@ -19,6 +19,9 @@ ECL 0.9g
|
|||
- DEF-FOREIGN-VAR rewritten to make variables visible from other files and to
|
||||
dereference also arrays and pointers. (M. Pasternacki)
|
||||
|
||||
- When creating a C-STRING, characters after the fill pointer are discarded,
|
||||
according to people's expectations.
|
||||
|
||||
* Compiler changes:
|
||||
|
||||
- Generated C functions now have readable names corresponding to appropriate
|
||||
|
|
|
|||
|
|
@ -372,13 +372,16 @@
|
|||
object)
|
||||
|
||||
(defmacro convert-to-cstring (object)
|
||||
object)
|
||||
;; This enforces that the string contains only as many characters as the
|
||||
;; fill-pointer determines Since ECL always sets a 0 character after the
|
||||
;; last element of a string, this way, the string is always zero-terminated
|
||||
(copy-seq object))
|
||||
|
||||
(defmacro free-cstring (object)
|
||||
object)
|
||||
|
||||
(defmacro with-cstring ((cstring string) &body body)
|
||||
`(let ((,cstring ,string)) ,@body))
|
||||
`(let ((,cstring (copy-seq ,string))) ,@body))
|
||||
|
||||
(defmacro with-cstrings (bindings &rest body)
|
||||
(if bindings
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue