diff options
Diffstat (limited to 'dis/original/Field')
| -rw-r--r-- | dis/original/Field/field.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/dis/original/Field/field.c b/dis/original/Field/field.c index a561f72..8565e8c 100644 --- a/dis/original/Field/field.c +++ b/dis/original/Field/field.c | |||
| @@ -22,7 +22,7 @@ | |||
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | #define MIN_FIELD_SIZE 16 | 24 | #define MIN_FIELD_SIZE 16 |
| 25 | #define MAX_FIELD_SIZE 16777216 | 25 | #define MAX_FIELD_SIZE (16777216*4) // This has been quadrupled from original |
| 26 | #define MIN_SEED -2147483647 | 26 | #define MIN_SEED -2147483647 |
| 27 | #define MAX_SEED -1 | 27 | #define MAX_SEED -1 |
| 28 | #define MIN_MOD_OFFSET 0 | 28 | #define MIN_MOD_OFFSET 0 |
| @@ -62,7 +62,7 @@ int main(int argc, char** argv){ | |||
| 62 | 62 | ||
| 63 | unsigned int l; | 63 | unsigned int l; |
| 64 | 64 | ||
| 65 | fscanf(stdin, "%d %d %d %d", &f, &seed, &mod_offset, &n); | 65 | assert(fscanf(stdin, "%d %d %d %d", &f, &seed, &mod_offset, &n) == 4); |
| 66 | 66 | ||
| 67 | assert((f >= MIN_FIELD_SIZE) && (f <= MAX_FIELD_SIZE)); | 67 | assert((f >= MIN_FIELD_SIZE) && (f <= MAX_FIELD_SIZE)); |
| 68 | assert((seed >= MIN_SEED) && (seed <= MAX_SEED)); | 68 | assert((seed >= MIN_SEED) && (seed <= MAX_SEED)); |
| @@ -72,12 +72,12 @@ int main(int argc, char** argv){ | |||
| 72 | int x; | 72 | int x; |
| 73 | int index; | 73 | int index; |
| 74 | index = 0; | 74 | index = 0; |
| 75 | fscanf(stdin,"%x", &x); | 75 | assert(fscanf(stdin,"%x", &x) == 1); |
| 76 | while(x!=0){ | 76 | while(x!=0){ |
| 77 | assert((x >= MIN_TOKEN_VALUE) && (x <= MAX_TOKEN_VALUE)); | 77 | assert((x >= MIN_TOKEN_VALUE) && (x <= MAX_TOKEN_VALUE)); |
| 78 | token[l].delimiter[index] = (unsigned char )x; | 78 | token[l].delimiter[index] = (unsigned char )x; |
| 79 | index++; | 79 | index++; |
| 80 | fscanf(stdin,"%x", &x); | 80 | assert(fscanf(stdin,"%x", &x) == 1); |
| 81 | } | 81 | } |
| 82 | assert((index >= MIN_TOKEN_LENGTH) && (index <= MAX_TOKEN_LENGTH)); | 82 | assert((index >= MIN_TOKEN_LENGTH) && (index <= MAX_TOKEN_LENGTH)); |
| 83 | token[l].length = index; | 83 | token[l].length = index; |
| @@ -132,6 +132,7 @@ int main(int argc, char** argv){ | |||
| 132 | } | 132 | } |
| 133 | index++; | 133 | index++; |
| 134 | } | 134 | } |
| 135 | token[l].subfields++; | ||
| 135 | STOP_LOOP | 136 | STOP_LOOP |
| 136 | } | 137 | } |
| 137 | 138 | ||
