aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/reader.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/reader.c b/src/reader.c
index 68a5f886..ef393ec7 100644
--- a/src/reader.c
+++ b/src/reader.c
@@ -14,6 +14,7 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include "reader.h"
#include "serd_internal.h"
#include <ctype.h>
@@ -343,6 +344,11 @@ serd_reader_read_chunk(SerdReader* reader)
st = serd_byte_source_advance(&reader->source);
}
+ if (peek_byte(reader) == 0) {
+ // Skip leading null byte, for reading from a null-delimited socket
+ eat_byte_safe(reader, 0);
+ }
+
return st ? st : read_statement(reader) ? SERD_SUCCESS : SERD_FAILURE;
}