1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

Finished the bulk of changes for gnupg 1.9. This included switching

to libgcrypt functions, using shared error codes from libgpg-error,
replacing the old functions we used to have in ../util by those in
../jnlib and ../common, renaming the malloc functions and a couple of
types.  Note, that not all changes are listed below becuause they are
too similar and done at far too many places.  As of today the code
builds using the current libgcrypt from CVS but it is very unlikely
that it actually works.
This commit is contained in:
Werner Koch 2003-06-18 19:56:13 +00:00
parent b7b07d36e8
commit c0c2c58054
90 changed files with 5078 additions and 2925 deletions

View file

@ -49,7 +49,7 @@ PKT_user_id *generate_photo_id(PKT_public_key *pk)
char *filename=NULL;
byte *photo=NULL;
byte header[16];
IOBUF file;
iobuf_t file;
header[0]=0x10; /* little side of photo header length */
header[1]=0; /* big side of photo header length */
@ -60,7 +60,7 @@ PKT_user_id *generate_photo_id(PKT_public_key *pk)
header[i]=0;
#define EXTRA_UID_NAME_SPACE 71
uid=m_alloc_clear(sizeof(*uid)+71);
uid=xcalloc (1,sizeof(*uid)+71);
printf(_("\nPick an image to use for your photo ID. "
"The image must be a JPEG file.\n"
@ -73,7 +73,7 @@ PKT_user_id *generate_photo_id(PKT_public_key *pk)
{
printf("\n");
m_free(filename);
xfree (filename);
filename=cpr_get("photoid.jpeg.add",
_("Enter JPEG filename for photo ID: "));
@ -101,7 +101,7 @@ PKT_user_id *generate_photo_id(PKT_public_key *pk)
}
}
photo=m_alloc(len);
photo=xmalloc (len);
iobuf_read(file,photo,len);
iobuf_close(file);
@ -110,7 +110,7 @@ PKT_user_id *generate_photo_id(PKT_public_key *pk)
photo[6]!='J' || photo[7]!='F' || photo[8]!='I' || photo[9]!='F')
{
log_error(_("\"%s\" is not a JPEG file\n"),filename);
m_free(photo);
xfree (photo);
photo=NULL;
continue;
}
@ -132,7 +132,7 @@ PKT_user_id *generate_photo_id(PKT_public_key *pk)
goto scram;
case 0:
free_attributes(uid);
m_free(photo);
xfree (photo);
photo=NULL;
continue;
}
@ -143,13 +143,13 @@ PKT_user_id *generate_photo_id(PKT_public_key *pk)
uid->ref=1;
scram:
m_free(filename);
m_free(photo);
xfree (filename);
xfree (photo);
if(error)
{
free_attributes(uid);
m_free(uid);
xfree (uid);
return NULL;
}
@ -283,7 +283,7 @@ void show_photos(const struct user_attribute *attrs,
if(!command)
goto fail;
name=m_alloc(16+strlen(EXTSEP_S)+
name=xmalloc (16+strlen(EXTSEP_S)+
strlen(image_type_to_string(args.imagetype,0))+1);
/* Make the filename. Notice we are not using the image
@ -302,7 +302,7 @@ void show_photos(const struct user_attribute *attrs,
if(exec_write(&spawn,NULL,command,name,1,1)!=0)
{
m_free(name);
xfree (name);
goto fail;
}
@ -311,7 +311,7 @@ void show_photos(const struct user_attribute *attrs,
image_type_to_string(args.imagetype,2));
#endif
m_free(name);
xfree (name);
fwrite(&attrs[i].data[offset],attrs[i].len-offset,1,spawn->tochild);