This commit is contained in:
Vitor Santos Costa
2018-07-23 17:13:51 +01:00
parent b4201dd0f3
commit bac1b63080
13 changed files with 123 additions and 79 deletions

View File

@@ -221,8 +221,9 @@ X_API int PL_get_nchars(term_t l, size_t *lengthp, char **s, unsigned flags) {
if (s) {
size_t len = strlen(out.val.c);
if (flags & (BUF_DISCARDABLE | BUF_RING)) {
strncpy(LOCAL_FileNameBuf, out.val.c, YAP_FILENAME_MAX);
if (!*s)
*s = LOCAL_FileNameBuf;
strncpy(*s, out.val.c, YAP_FILENAME_MAX);
pop_text_stack(lvl);
return true;
}