Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed a few IO bugs.

  • Loading branch information...
commit 0f5ec625fca5e242028d68379bb7640c11bf0aaf 1 parent 5158d2b
Caleb James DeLisle authored
Showing with 3 additions and 3 deletions.
  1. +1 −1  io/ArrayReader.c
  2. +1 −1  io/Reader.h
  3. +1 −1  io/Writer.h
View
2  io/ArrayReader.c
@@ -56,7 +56,7 @@ static int read(void* readInto, size_t length, const struct Reader* reader)
(struct ArrayReader_context*) reader->context;
/* Prove that it doesn't run off the end of the buffer or roll over. */
- if (context->pointer + length >= context->endPointer
+ if (context->pointer + length > context->endPointer
|| context->pointer + length < context->pointer)
{
return -1;
View
2  io/Reader.h
@@ -58,7 +58,7 @@ struct Reader {
static inline uint##bytes##_t Reader_read##bytes (struct Reader* reader) \
{ \
uint##bytes##_t num; \
- reader->read(&num, bytes, reader); \
+ reader->read(&num, bytes/8, reader); \
return num; \
}
View
2  io/Writer.h
@@ -47,7 +47,7 @@ struct Writer {
static inline int Writer_write##bytes (struct Writer* writer, uint##bytes##_t number) \
{ \
uint##bytes##_t num = number; \
- return writer->write(&num, bytes, writer); \
+ return writer->write(&num, bytes/8, writer); \
}
Writer_writeGeneric(8)
Please sign in to comment.
Something went wrong with that request. Please try again.