diff options
author | Robin Gareus <robin@gareus.org> | 2019-06-20 17:21:42 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2019-06-20 18:20:00 +0200 |
commit | 73d90f6a983af8fda0b7f9ac5f66f40513482ecb (patch) | |
tree | 13834dc92783ba2d109ffc3d26c8d8c73f938f36 /ptunxor.cc | |
parent | 4f2708e4d29e54f2e8d2d5c5fbf8002905bc1021 (diff) |
API cleanup: const-ness, remove public variables
Do not allow users of the API to modify internal variables,
prefer accessor methods to constant data.
Use const-references whenever possible (don't copy-construct arguments),
likewise prefer direct references over iterators.
Diffstat (limited to 'ptunxor.cc')
-rw-r--r-- | ptunxor.cc | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -37,9 +37,12 @@ int main(int argc, char** argv) { fprintf(stderr, "Can't decrypt pt session, still try to dump...\n"); } - if (ptf.ptfunxored) { - for (i = 0; i < ptf.len; i++) { - printf("%c", ptf.ptfunxored[i]); + const unsigned char* unxored = ptf.unxored_data(); + uint64_t len = ptf.unxored_size (); + + if (unxored) { + for (i = 0; i < len; i++) { + printf("%c", unxored[i]); } } |