Skip to content

Commit

Permalink
Fixed a few IO bugs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Caleb James DeLisle committed Nov 12, 2012
1 parent 5158d2b commit 0f5ec62
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion io/ArrayReader.c
Expand Up @@ -56,7 +56,7 @@ static int read(void* readInto, size_t length, const struct Reader* reader)
(struct ArrayReader_context*) reader->context; (struct ArrayReader_context*) reader->context;


/* Prove that it doesn't run off the end of the buffer or roll over. */ /* 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) || context->pointer + length < context->pointer)
{ {
return -1; return -1;
Expand Down
2 changes: 1 addition & 1 deletion io/Reader.h
Expand Up @@ -58,7 +58,7 @@ struct Reader {
static inline uint##bytes##_t Reader_read##bytes (struct Reader* reader) \ static inline uint##bytes##_t Reader_read##bytes (struct Reader* reader) \
{ \ { \
uint##bytes##_t num; \ uint##bytes##_t num; \
reader->read(&num, bytes, reader); \ reader->read(&num, bytes/8, reader); \
return num; \ return num; \
} }


Expand Down
2 changes: 1 addition & 1 deletion io/Writer.h
Expand Up @@ -47,7 +47,7 @@ struct Writer {
static inline int Writer_write##bytes (struct Writer* writer, uint##bytes##_t number) \ static inline int Writer_write##bytes (struct Writer* writer, uint##bytes##_t number) \
{ \ { \
uint##bytes##_t num = number; \ uint##bytes##_t num = number; \
return writer->write(&num, bytes, writer); \ return writer->write(&num, bytes/8, writer); \
} }


Writer_writeGeneric(8) Writer_writeGeneric(8)
Expand Down

0 comments on commit 0f5ec62

Please sign in to comment.