summaryrefslogtreecommitdiff
path: root/io_buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'io_buffer.c')
-rw-r--r--io_buffer.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/io_buffer.c b/io_buffer.c
index 7e580c8633..7715aa0d37 100644
--- a/io_buffer.c
+++ b/io_buffer.c
@@ -854,11 +854,10 @@ io_buffer_get_bytes_for_writing(struct rb_io_buffer *buffer, void **base, size_t
if (buffer->base) {
*base = buffer->base;
*size = buffer->size;
-
- return;
+ } else {
+ *base = NULL;
+ *size = 0;
}
-
- rb_raise(rb_eIOBufferAllocationError, "The buffer is not allocated!");
}
void
@@ -880,11 +879,10 @@ io_buffer_get_bytes_for_reading(struct rb_io_buffer *buffer, const void **base,
if (buffer->base) {
*base = buffer->base;
*size = buffer->size;
-
- return;
+ } else {
+ *base = NULL;
+ *size = 0;
}
-
- rb_raise(rb_eIOBufferAllocationError, "The buffer is not allocated!");
}
void