diff options
author | Steven Moreland <smoreland@google.com> | 2019-12-09 13:04:16 -0800 |
---|---|---|
committer | Steven Moreland <smoreland@google.com> | 2019-12-09 13:05:07 -0800 |
commit | d3721d607bf13993bb66a200568406ce987f75ad (patch) | |
tree | ff383c587534d5aabb6db259d0e1a2bef248a478 /code_writer.cpp | |
parent | b3f4d624dfb046fcc04f63c89651ef3394eb6bc7 (diff) | |
download | aidl-d3721d607bf13993bb66a200568406ce987f75ad.tar.gz |
Warning and fixup for user string as format.
Fixes: 145819305
Test: aidl_parser_fuzzer w/ cases such as "Wenum o{//%n"
Change-Id: I3d8b456e4c465a7be4343d2591c0e8ccef6e3989
Diffstat (limited to 'code_writer.cpp')
-rw-r--r-- | code_writer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/code_writer.cpp b/code_writer.cpp index 6d54d405..096c8955 100644 --- a/code_writer.cpp +++ b/code_writer.cpp @@ -89,12 +89,12 @@ bool CodeWriter::Close() { } CodeWriter& CodeWriter::operator<<(const char* s) { - Write(s); + Write("%s", s); return *this; } CodeWriter& CodeWriter::operator<<(const std::string& str) { - Write(str.c_str()); + Write("%s", str.c_str()); return *this; } |