* ffi-tools/ffi-tools.c (ffit_extract_list_of_strings): fixed
wrong pointer handling
This commit is contained in:
parent
092160e721
commit
a56a9ae9e9
|
@ -59,7 +59,7 @@ char** ffit_extract_list_of_strings(s48_value list)
|
||||||
S48_GC_PROTECT_3(list, res, e);
|
S48_GC_PROTECT_3(list, res, e);
|
||||||
l = length_scheme_list(list);
|
l = length_scheme_list(list);
|
||||||
|
|
||||||
if ((*a = (char *) calloc(l + 1, sizeof(char *))) == NULL)
|
if ((a = (char **) calloc(l + 1, sizeof(char *))) == NULL)
|
||||||
s48_raise_out_of_memory_error();
|
s48_raise_out_of_memory_error();
|
||||||
a[l] = NULL;
|
a[l] = NULL;
|
||||||
|
|
||||||
|
@ -67,8 +67,8 @@ char** ffit_extract_list_of_strings(s48_value list)
|
||||||
i = 0;
|
i = 0;
|
||||||
while (e != S48_NULL) {
|
while (e != S48_NULL) {
|
||||||
if (S48_PAIR_P(e))
|
if (S48_PAIR_P(e))
|
||||||
if (S48_STRING_P(e)) {
|
if (S48_STRING_P(S48_CAR(e))) {
|
||||||
a[i] = s48_extract_string(e);
|
a[i] = s48_extract_string(S48_CAR(e));
|
||||||
e = S48_CDR(e);
|
e = S48_CDR(e);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue