summaryrefslogtreecommitdiff
path: root/ext/dio/dio.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/dio/dio.c')
-rw-r--r--ext/dio/dio.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/dio/dio.c b/ext/dio/dio.c
index 1beec45db3..7f25bf17df 100644
--- a/ext/dio/dio.c
+++ b/ext/dio/dio.c
@@ -187,8 +187,10 @@ PHP_FUNCTION(dio_read)
if (res <= 0) {
RETURN_NULL();
}
-
+
+ data = erealloc(data, res);
data[res] = 0;
+
RETURN_STRINGL(data, res, 0);
}
/* }}} */