- int i;
- uint32_t max = 0, old = 0;
-
- for (i = 0; i <= afhi->chunks_total; i++) {
- uint32_t val = afhi->chunk_table[i];
- write_u32(buf + 4 * i, val);
- /*
- * If the first chunk is the header, do not consider it for the
- * calculation of the largest chunk size.
- */
- if (i == 0 || (i == 1 && afhi->header_len > 0)) {
- old = val;
- continue;
- }
- max = PARA_MAX(max, val - old);
- old = val;
- }
- return max;
+ uint32_t n;
+
+ if (!afhi->chunk_table)
+ return;
+ for (n = 0; n <= afhi->chunks_total; n++)
+ write_u32(buf + 4 * n, afhi->chunk_table[n]);