diff --git a/g10/ChangeLog b/g10/ChangeLog index 25ae5e549..96ba9476e 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,9 @@ +2002-07-01 David Shaw + + * packet.h, build-packet.c (build_attribute_subpkt), exec.c + (expand_args), mkdtemp.c (mkdtemp), photoid.c + (parse_image_header): Fix some signedness compiler warnings. + 2002-07-01 Werner Koch * encode.c (encode_symmetric): Do not use the new encryption code. diff --git a/g10/build-packet.c b/g10/build-packet.c index e24ac3b2a..fd1540528 100644 --- a/g10/build-packet.c +++ b/g10/build-packet.c @@ -872,8 +872,8 @@ build_sig_subpkt_from_sig( PKT_signature *sig ) void build_attribute_subpkt(PKT_user_id *uid,byte type, - const void *buf,int buflen, - const void *header,int headerlen) + const void *buf,u32 buflen, + const void *header,u32 headerlen) { byte *attrib; int idx; @@ -912,7 +912,8 @@ build_attribute_subpkt(PKT_user_id *uid,byte type, /* Tack on our data at the end */ - memcpy(&attrib[idx],header,headerlen); + if(headerlen>0) + memcpy(&attrib[idx],header,headerlen); memcpy(&attrib[idx+headerlen],buf,buflen); uid->attrib_len+=idx+headerlen+buflen; } diff --git a/g10/exec.c b/g10/exec.c index 229c968bc..893718ad1 100644 --- a/g10/exec.c +++ b/g10/exec.c @@ -172,7 +172,7 @@ static int make_tempdir(struct exec_info *info) static int expand_args(struct exec_info *info,const char *args_in) { const char *ch=args_in; - int size,len; + unsigned int size,len; info->use_temp_files=0; info->keep_temp_files=0; diff --git a/g10/mkdtemp.c b/g10/mkdtemp.c index 0323486a3..3abdc1da6 100644 --- a/g10/mkdtemp.c +++ b/g10/mkdtemp.c @@ -38,7 +38,7 @@ char *mkdtemp(char *template) { - int attempts,idx,count=0; + unsigned int attempts,idx,count=0; byte *ch; idx=strlen(template); @@ -61,7 +61,7 @@ char *mkdtemp(char *template) /* Try 4 times to make the temp directory */ for(attempts=0;attempts<4;attempts++) { - int remaining=count; + unsigned int remaining=count; char *marker=ch; byte *randombits; diff --git a/g10/packet.h b/g10/packet.h index 023680b9e..79d6dfa1b 100644 --- a/g10/packet.h +++ b/g10/packet.h @@ -154,7 +154,7 @@ typedef struct { struct user_attribute { byte type; const byte *data; - unsigned long len; + u32 len; }; typedef struct { @@ -413,8 +413,8 @@ void build_sig_subpkt( PKT_signature *sig, sigsubpkttype_t type, void build_sig_subpkt_from_sig( PKT_signature *sig ); int delete_sig_subpkt(subpktarea_t *buffer, sigsubpkttype_t type ); void build_attribute_subpkt(PKT_user_id *uid,byte type, - const void *buf,int buflen, - const void *header,int headerlen); + const void *buf,u32 buflen, + const void *header,u32 headerlen); /*-- free-packet.c --*/ void free_symkey_enc( PKT_symkey_enc *enc ); diff --git a/g10/photoid.c b/g10/photoid.c index fb7f7b91f..8a9101d36 100644 --- a/g10/photoid.c +++ b/g10/photoid.c @@ -158,7 +158,7 @@ PKT_user_id *generate_photo_id(PKT_public_key *pk) /* Returns 0 for error, 1 for valid */ int parse_image_header(const struct user_attribute *attr,byte *type,u32 *len) { - int headerlen; + u16 headerlen; if(attr->len<3) return 0;