* Zero out any bytes left in the last block of the DDB capture buffer. This * is run shortly before writing the blocks to disk, rather than when output * capture is stopped, in order to avoid injecting nul's into the middle of * output. */
| 246 | * output. |
| 247 | */ |
| 248 | static void |
| 249 | db_capture_zeropad(void) |
| 250 | { |
| 251 | u_int len; |
| 252 | |
| 253 | len = min(TEXTDUMP_BLOCKSIZE, (db_capture_bufsize - |
| 254 | db_capture_bufoff) % TEXTDUMP_BLOCKSIZE); |
| 255 | bzero(db_capture_buf + db_capture_bufoff, len); |
| 256 | db_capture_bufpadding = len; |
| 257 | } |
| 258 | |
| 259 | /* |
| 260 | * Reset capture state, which flushes buffers. |
no test coverage detected