diff options
author | Karl-Heinz Zimmer <[email protected]> | 2002-01-14 20:33:50 +0000 |
---|---|---|
committer | Karl-Heinz Zimmer <[email protected]> | 2002-01-14 20:33:50 +0000 |
commit | 1e9cbbef87b457457e3f909a285a414a670f1e7e (patch) | |
tree | a8b5aebfc092e8146b2d5534e687ebfbf5616e53 /gpgmeplug | |
parent | Added specification of strings and bool values for S/MIME signing and encrypt... (diff) | |
download | gpgme-1e9cbbef87b457457e3f909a285a414a670f1e7e.tar.gz gpgme-1e9cbbef87b457457e3f909a285a414a670f1e7e.zip |
fixed bug in function "storeNewCharPtr()"
Diffstat (limited to 'gpgmeplug')
-rw-r--r-- | gpgmeplug/gpgmeplug.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/gpgmeplug/gpgmeplug.c b/gpgmeplug/gpgmeplug.c index 7662876e..249d0a84 100644 --- a/gpgmeplug/gpgmeplug.c +++ b/gpgmeplug/gpgmeplug.c @@ -51,6 +51,10 @@ #include <errno.h> #include <time.h> +#ifndef BUG_URL +#define BUG_URL "http:://www.gnupg.org/aegypten/" +#endif + #include "gpgme.h" #ifndef GPGMEPLUG_PROTOCOL #define GPGMEPLUG_PROTOCOL GPGME_PROTOCOL_OpenPGP @@ -120,6 +124,7 @@ typedef struct { + const char* bugURL; const char* signatureKeyCertificate; SignatureAlgorithm signatureAlgorithm; SendCertificates sendCertificates; @@ -189,7 +194,10 @@ passphrase_cb (void *opaque, const char *desc, void *r_hd) bool initialize() { - config.signatureKeyCertificate = ""; + config.bugURL = malloc( strlen( BUG_URL ) + 1 ); + strcpy( (char* )config.bugURL, BUG_URL ); + config.signatureKeyCertificate = malloc( 1 ); + strcpy( (char* )config.signatureKeyCertificate, "" ); config.signatureAlgorithm = SignAlg_SHA1; config.sendCertificates = SendCert_SendChainWithRoot; config.signEmail = SignEmail_SignAll; @@ -254,6 +262,9 @@ bool hasFeature( Feature flag ) } +const char* bugURL(){ return config.bugURL; } + + void unsafeStationery( void** pixmap, const char** menutext, char* accel, const char** tooltip, const char** statusbartext ){} @@ -755,13 +766,10 @@ bool certificateValidity( const char* certificate, void storeNewCharPtr( char** dest, const char* src ) { - int sLen; - if( *dest && src ) { - sLen = strlen( src ); - *dest = malloc( sLen + 1 ); - strncpy( *dest, src, sLen ); - *dest[sLen] = '\0'; - } + int sLen = strlen( src ); + *dest = malloc( sLen + 1 ); + strncpy( *dest, src, sLen ); + *dest[sLen] = '\0'; } |