iowatcher: Fix buffer overwrite issue

Current code allocates buffer for path based on strdup, which would let
the size of path equals to the size of blktrace_dest_dir. But the code
next that joins it with the filename of dump file, which would overwrite
the buffer, and triggered an issue like following:

$ ./iowatcher -t trace.dump -o trace.svg
Unable to find trace file ./trace.dumpY

Refactoring join_path a bit to fix this issue.

Cc: Liu Bo <>
Signed-off-by: Yuanhan Liu <>
Signed-off-by: Chris Mason <>
1 file changed
tree: f1a9c4f53591ba3d8425b8c6d62d058149d4bb04
  1. iowatcher/