[CM] Weirdness with s7_load_c_string_with_environment, xxd fun

bil at ccrma.Stanford.EDU bil at ccrma.Stanford.EDU
Fri Jul 9 06:35:22 PDT 2021

Thanks for the example -- I had to add #include <string.
I get the error "string is not terminated".  xxd -i generates
an array that does not end with 0, so when it's cast to
a C string, it is not terminated.  The example scheme code
for make-repl-bits.scm adds that 0 at the end (see also
nrepl-bits.h).  If i add the ending 0's to the 2 resources
(leaving the length alone because it's viewed as a c string
length), your program appears to work.

/home/bil/test/bug1/ g++ -o m main.cpp -I. s7.o -lm -ldl
/home/bil/test/bug1/ m
here load_with_resources
Loading main.scm as embedded resource
here load_with_resources
Loading core.scm as embedded resource

More information about the Cmdist mailing list