From 97748b1b0c11bd2fdd49ee06b9bf3caf98103966 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Mon, 6 Oct 2008 17:31:00 +0000 Subject: [PATCH] Fix some signed/unsigned warnings git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20824 dc483132-0cff-0310-8789-dd5450dbe970 --- src/tests/asn.1/krb5_encode_test.c | 2 +- src/tests/asn.1/ktest_equal.c | 4 ++-- src/tests/asn.1/trval.c | 2 +- src/tests/asn.1/utility.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/tests/asn.1/krb5_encode_test.c b/src/tests/asn.1/krb5_encode_test.c index a6f869492..cbaddd8f9 100644 --- a/src/tests/asn.1/krb5_encode_test.c +++ b/src/tests/asn.1/krb5_encode_test.c @@ -28,7 +28,7 @@ static void encoder_print_results(code, typestring, description) printf("encode_krb5_%s%s:\n", typestring, description); r = trval2(stdout, code->data, code->length, 0, &rlen); printf("\n\n"); - if (rlen != code->length) { + if (rlen < 0 || (unsigned int) rlen != code->length) { printf("Error: length mismatch: was %d, parsed %d\n", code->length, rlen); exit(1); diff --git a/src/tests/asn.1/ktest_equal.c b/src/tests/asn.1/ktest_equal.c index 7f2fa44b1..c7433255f 100644 --- a/src/tests/asn.1/ktest_equal.c +++ b/src/tests/asn.1/ktest_equal.c @@ -564,7 +564,7 @@ int ktest_equal_array_of_octet(length, ref, var) krb5_octet * ref; krb5_octet * var; { - int i, p=TRUE; + unsigned int i, p=TRUE; if(ref==var) return TRUE; else if(ref == NULL || var == NULL) return FALSE; @@ -578,7 +578,7 @@ int ktest_equal_array_of_char(length, ref, var) char * ref; char * var; { - int i, p=TRUE; + unsigned int i, p=TRUE; if(ref==var) return TRUE; else if(ref == NULL || var == NULL) return FALSE; diff --git a/src/tests/asn.1/trval.c b/src/tests/asn.1/trval.c index 4506a3f50..f94459bbf 100644 --- a/src/tests/asn.1/trval.c +++ b/src/tests/asn.1/trval.c @@ -145,7 +145,7 @@ int trval(fin, fout) p = (unsigned char *)malloc(maxlen); len = 0; while ((cc = fgetc(fin)) != EOF) { - if (len == maxlen) { + if ((unsigned int) len == maxlen) { maxlen += BUFSIZ; p = (unsigned char *)realloc(p, maxlen); } diff --git a/src/tests/asn.1/utility.c b/src/tests/asn.1/utility.c index 6ad2e9de8..19abfbdc3 100644 --- a/src/tests/asn.1/utility.c +++ b/src/tests/asn.1/utility.c @@ -21,7 +21,7 @@ asn1_error_code asn1_krb5_data_unparse(code, s) if(*s==NULL) return ENOMEM; strcpy(*s,""); }else{ - int i; + unsigned int i; *s = (char*)calloc((size_t) 3*(code->length), sizeof(char)); if(*s == NULL) return ENOMEM; -- 2.26.2