summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorGeoff Thorpe <geoff@openssl.org>2003-10-29 20:24:15 +0000
committerGeoff Thorpe <geoff@openssl.org>2003-10-29 20:24:15 +0000
commit27545970134d703ed96027aac9b67eced124eec3 (patch)
tree2f878acf303cc26e3b6db6a0ec25c10c91e3d32d /apps
parent2ce90b9b7481381dff584726d84345a0260ca4d1 (diff)
A general spring-cleaning (in autumn) to fix up signed/unsigned warnings.
I have tried to convert 'len' type variable declarations to unsigned as a means to address these warnings when appropriate, but when in doubt I have used casts in the comparisons instead. The better solution (that would get us all lynched by API users) would be to go through and convert all the function prototypes and structure definitions to use unsigned variables except when signed is necessary. The proliferation of (signed) "int" for strictly non-negative uses is unfortunate.
Diffstat (limited to 'apps')
-rw-r--r--apps/ca.c3
-rw-r--r--apps/enc.c2
-rw-r--r--apps/passwd.c3
-rw-r--r--apps/rand.c2
4 files changed, 6 insertions, 4 deletions
diff --git a/apps/ca.c b/apps/ca.c
index 780868a9f0..15211b8443 100644
--- a/apps/ca.c
+++ b/apps/ca.c
@@ -3005,7 +3005,8 @@ int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold, ASN1_G
char *tmp = NULL;
char *rtime_str, *reason_str = NULL, *arg_str = NULL, *p;
int reason_code = -1;
- int i, ret = 0;
+ int ret = 0;
+ unsigned int i;
ASN1_OBJECT *hold = NULL;
ASN1_GENERALIZEDTIME *comp_time = NULL;
tmp = BUF_strdup(str);
diff --git a/apps/enc.c b/apps/enc.c
index 0a9f7310bf..ae18452e86 100644
--- a/apps/enc.c
+++ b/apps/enc.c
@@ -534,7 +534,7 @@ bad:
if (!nosalt)
{
printf("salt=");
- for (i=0; i<sizeof salt; i++)
+ for (i=0; i<(int)sizeof(salt); i++)
printf("%02X",salt[i]);
printf("\n");
}
diff --git a/apps/passwd.c b/apps/passwd.c
index 3ad91d89d6..b9d9d7a36a 100644
--- a/apps/passwd.c
+++ b/apps/passwd.c
@@ -312,7 +312,8 @@ static char *md5crypt(const char *passwd, const char *magic, const char *salt)
static char out_buf[6 + 9 + 24 + 2]; /* "$apr1$..salt..$.......md5hash..........\0" */
unsigned char buf[MD5_DIGEST_LENGTH];
char *salt_out;
- int n, i;
+ int n;
+ unsigned int i;
EVP_MD_CTX md,md2;
size_t passwd_len, salt_len;
diff --git a/apps/rand.c b/apps/rand.c
index 63724bc730..a893896033 100644
--- a/apps/rand.c
+++ b/apps/rand.c
@@ -205,7 +205,7 @@ int MAIN(int argc, char **argv)
int chunk;
chunk = num;
- if (chunk > sizeof buf)
+ if (chunk > (int)sizeof(buf))
chunk = sizeof buf;
r = RAND_bytes(buf, chunk);
if (r <= 0)