Skip to content

Commit f9dedbc

Browse files
author
kalibera
committed
Report error when writing a long string fails on Windows due to allocation
problem (PR#18878). git-svn-id: https://svn.r-project.org/R/trunk@88349 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent 0d0e155 commit f9dedbc

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/extra/trio/trio.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4108,9 +4108,12 @@ TRIO_ARGS2((self, output),
41084108

41094109
if (self->error == 0)
41104110
{
4111-
trio_xstring_append_char((trio_string_t *)self->location,
4112-
(char)output);
4113-
self->committed++;
4111+
if (trio_xstring_append_char((trio_string_t *)self->location,
4112+
(char)output)) {
4113+
self->committed++;
4114+
} else {
4115+
self->error = TRIO_ERROR_RETURN(TRIO_ENOMEM, 0);
4116+
}
41144117
}
41154118
/* The processed variable must always be increased */
41164119
self->processed++;

0 commit comments

Comments
 (0)