sandbox/linux/bpf_dsl: add DumpBPF::StringPrintProgram
commite1bc35ab4d1f3da73d0532dbbcc3999fcb599fe3
authormdempsky <mdempsky@chromium.org>
Mon, 24 Aug 2015 22:40:26 +0000 (24 15:40 -0700)
committerCommit bot <commit-bot@chromium.org>
Mon, 24 Aug 2015 22:41:10 +0000 (24 22:41 +0000)
treeed72df82ff8a2fc4ddd45c98735c1d93bcdd2b0e
parent2d1b445673161962e56cf51533a181656f40ae5c
sandbox/linux/bpf_dsl: add DumpBPF::StringPrintProgram

Android doesn't have open_memstream, so the code had to be cleaned up
to use something else.  base::StringAppendF seems like the least bad
option, and this code will eventually be test-only code anyway.

While here, clean up the code to be clang-format'able.  Also, satisfy
my pedantic side by switching from int casts to using <inttypes.h>.

BUG=414363

Review URL: https://codereview.chromium.org/1310683002

Cr-Commit-Position: refs/heads/master@{#345195}
sandbox/linux/bpf_dsl/dump_bpf.cc
sandbox/linux/bpf_dsl/dump_bpf.h