[GPGME] gpgme data buffer not showing any data

Garrett Kajmowicz gkajmowi at tbaytel.net
Sun Jan 7 02:15:18 CET 2007


I'm trying to push some data into a gogme_data_t buffer from an object and I'm 
not having any luck.  The following code should return 8, but insted I'm 
getting -1.  Please advise as to what I am missing.


-     Garrett

#define D_FILE_OFFSET_BITS 64

#include <gpgme.h>
#include <string>
#include <iostream>

int main(){
        gpgme_error_t err;
        std::string msg("Message");

        gpgme_data_t In;

        err = gpgme_data_new_from_mem(&In, msg.c_str(), msg.length(), 1);

        if(err){
                std::cout << "An error occured copying data" << std::endl;
        }

        off_t len;
        len = gpgme_data_seek(In, 0, SEEK_END);
        std::cout << "Size of data: " << len << std::endl;

        return 0;
}



More information about the Gnupg-devel mailing list