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.
This commit is contained in:
Andre Heinecke 2019-02-21 13:04:54 +01:00
parent 4c49417cc0
commit 6175025c82
No known key found for this signature in database
GPG Key ID: 2978E9D40CBABA5C

View File

@ -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;
}