fixed bug in function "storeNewCharPtr()"
This commit is contained in:
parent
e6c1c2828f
commit
1e9cbbef87
@ -51,6 +51,10 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
|
#ifndef BUG_URL
|
||||||
|
#define BUG_URL "http:://www.gnupg.org/aegypten/"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "gpgme.h"
|
#include "gpgme.h"
|
||||||
#ifndef GPGMEPLUG_PROTOCOL
|
#ifndef GPGMEPLUG_PROTOCOL
|
||||||
#define GPGMEPLUG_PROTOCOL GPGME_PROTOCOL_OpenPGP
|
#define GPGMEPLUG_PROTOCOL GPGME_PROTOCOL_OpenPGP
|
||||||
@ -120,6 +124,7 @@
|
|||||||
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
const char* bugURL;
|
||||||
const char* signatureKeyCertificate;
|
const char* signatureKeyCertificate;
|
||||||
SignatureAlgorithm signatureAlgorithm;
|
SignatureAlgorithm signatureAlgorithm;
|
||||||
SendCertificates sendCertificates;
|
SendCertificates sendCertificates;
|
||||||
@ -189,7 +194,10 @@ passphrase_cb (void *opaque, const char *desc, void *r_hd)
|
|||||||
|
|
||||||
bool initialize()
|
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.signatureAlgorithm = SignAlg_SHA1;
|
||||||
config.sendCertificates = SendCert_SendChainWithRoot;
|
config.sendCertificates = SendCert_SendChainWithRoot;
|
||||||
config.signEmail = SignEmail_SignAll;
|
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,
|
void unsafeStationery( void** pixmap, const char** menutext, char* accel,
|
||||||
const char** tooltip, const char** statusbartext ){}
|
const char** tooltip, const char** statusbartext ){}
|
||||||
|
|
||||||
@ -755,13 +766,10 @@ bool certificateValidity( const char* certificate,
|
|||||||
|
|
||||||
void storeNewCharPtr( char** dest, const char* src )
|
void storeNewCharPtr( char** dest, const char* src )
|
||||||
{
|
{
|
||||||
int sLen;
|
int sLen = strlen( src );
|
||||||
if( *dest && src ) {
|
*dest = malloc( sLen + 1 );
|
||||||
sLen = strlen( src );
|
strncpy( *dest, src, sLen );
|
||||||
*dest = malloc( sLen + 1 );
|
*dest[sLen] = '\0';
|
||||||
strncpy( *dest, src, sLen );
|
|
||||||
*dest[sLen] = '\0';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user