fix warnings

This commit is contained in:
Vitor Santos Costa
2017-10-06 13:05:12 +01:00
parent dd48ba6f91
commit da94db80cf
20 changed files with 213 additions and 154 deletions

View File

@@ -223,13 +223,13 @@ X_API int PL_get_nchars(term_t l, size_t *lengthp, char **s, unsigned flags) {
out.type |= YAP_STRING_NCHARS;
out.max = *lengthp;
}
char *sf = malloc(strlen(out.val.c)+1);
strcpy(sf, out.val.c);
if (!Yap_CVT_Text(&inp, &out PASS_REGS)) {
pop_text_stack(lvl);
return false;
}
*s = out.val.c = sf;
if (*s) {
*s = out.val.c;
}
return true;
}