Change -EOF for EOF (it is worth -1), fix assertion
[babeltrace.git] / formats / ctf / types / integer.c
index 9b918954d269dbb4d04c83f2f4146cec7a5b83f1..b5c59ddea1bf4dc9704e096f53c6e5cdc5cc0c74 100644 (file)
@@ -40,11 +40,11 @@ int _aligned_integer_read(struct stream_pos *ppos,
        int rbo = (integer_declaration->byte_order != BYTE_ORDER);      /* reverse byte order */
 
        ctf_align_pos(pos, integer_declaration->p.alignment);
        int rbo = (integer_declaration->byte_order != BYTE_ORDER);      /* reverse byte order */
 
        ctf_align_pos(pos, integer_declaration->p.alignment);
-       assert(!(pos->offset % CHAR_BIT));
 
        if (!ctf_pos_access_ok(pos, integer_declaration->len))
                return -EFAULT;
 
 
        if (!ctf_pos_access_ok(pos, integer_declaration->len))
                return -EFAULT;
 
+       assert(!(pos->offset % CHAR_BIT));
        if (!integer_declaration->signedness) {
                switch (integer_declaration->len) {
                case 8:
        if (!integer_declaration->signedness) {
                switch (integer_declaration->len) {
                case 8:
@@ -142,11 +142,11 @@ int _aligned_integer_write(struct stream_pos *ppos,
        int rbo = (integer_declaration->byte_order != BYTE_ORDER);      /* reverse byte order */
 
        ctf_align_pos(pos, integer_declaration->p.alignment);
        int rbo = (integer_declaration->byte_order != BYTE_ORDER);      /* reverse byte order */
 
        ctf_align_pos(pos, integer_declaration->p.alignment);
-       assert(!(pos->offset % CHAR_BIT));
 
        if (!ctf_pos_access_ok(pos, integer_declaration->len))
                return -EFAULT;
 
 
        if (!ctf_pos_access_ok(pos, integer_declaration->len))
                return -EFAULT;
 
+       assert(!(pos->offset % CHAR_BIT));
        if (pos->dummy)
                goto end;
        if (!integer_declaration->signedness) {
        if (pos->dummy)
                goto end;
        if (!integer_declaration->signedness) {
This page took 0.023279 seconds and 4 git commands to generate.