This commit is contained in:
Vitor Santos Costa 2016-09-23 01:37:36 -05:00
parent 298b287859
commit bee39cb385

View File

@ -209,6 +209,10 @@ X_API int PL_get_nchars(term_t l, size_t *lengthp, char **s, unsigned flags) {
} else {
out.enc = ENC_ISO_LATIN1;
}
if (flags & BUF_MALLOC) {
out.type |= YAP_STRING_MALLOC;
}
if (lengthp) {
out.type |= YAP_STRING_NCHARS;
out.max = *lengthp;
@ -232,9 +236,6 @@ int PL_get_wchars(term_t l, size_t *lengthp, wchar_t **s, unsigned flags) {
out.type = YAP_STRING_WCHARS;
if (flags & BUF_MALLOC) {
out.type |= YAP_STRING_MALLOC;
out.val.w = *s;
} else {
out.val.w = NULL;
}
if (lengthp) {
out.type |= YAP_STRING_NCHARS;