diff options
author | Andre Heinecke <[email protected]> | 2019-02-21 12:04:54 +0000 |
---|---|---|
committer | Andre Heinecke <[email protected]> | 2019-02-21 12:04:54 +0000 |
commit | 6175025c822678102c3f089e37952aa84b19a3ec (patch) | |
tree | ba446595670b04625e171913c3e15f14bd057ccf | |
parent | core,w32: Fix missing sentinel in dir name builder. (diff) | |
download | gpgme-6175025c822678102c3f089e37952aa84b19a3ec.tar.gz gpgme-6175025c822678102c3f089e37952aa84b19a3ec.zip |
cpp: Make GpgME::Data::toKeys really const
* lang/cpp/src/data.cpp (GpgME::Data::toKeys): Rewind afterards.
--
This fixes unexpected behavior that the seek pointer is changed
after calling the const toKeys.
-rw-r--r-- | lang/cpp/src/data.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lang/cpp/src/data.cpp b/lang/cpp/src/data.cpp index 547ec76e..7a93cbc2 100644 --- a/lang/cpp/src/data.cpp +++ b/lang/cpp/src/data.cpp @@ -256,6 +256,8 @@ std::vector<GpgME::Key> GpgME::Data::toKeys(Protocol proto) const while (!gpgme_op_keylist_next (ctx->impl()->ctx, &key)) { ret.push_back(GpgME::Key(key, false)); } + gpgme_data_seek (d->data, 0, SEEK_SET); + delete ctx; return ret; } |