Resize the buffer of a splitLine. Since the new buffer may not be in the same place, we need to first unsplit, resize, then resplit.
| 275 | // Resize the buffer of a splitLine. |
| 276 | // Since the new buffer may not be in the same place, we need to first unsplit, resize, then resplit. |
| 277 | void resizeSplitLine(splitLine_t * line, int newsize) |
| 278 | { |
| 279 | // First unsplit it. |
| 280 | unsplitSplitLine(line); |
| 281 | // Resize the buffer, giving a little extra room. |
| 282 | line->maxBufLen = newsize + 50; |
| 283 | line->buffer = (char *)realloc(line->buffer, line->maxBufLen); |
| 284 | if (line->buffer == NULL) |
| 285 | { |
| 286 | fatalError("samblaster: Failed to reallocate to a larger read buffer size.\n"); |
| 287 | } |
| 288 | // Now resplit the line. |
| 289 | splitSplitLine(line, line->numFields); |
| 290 | } |
| 291 | |
| 292 | |
| 293 | // Change a field into a value. |
no test coverage detected