Fix some signed/unsigned warnings
authorKen Raeburn <raeburn@mit.edu>
Mon, 6 Oct 2008 17:31:00 +0000 (17:31 +0000)
committerKen Raeburn <raeburn@mit.edu>
Mon, 6 Oct 2008 17:31:00 +0000 (17:31 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20824 dc483132-0cff-0310-8789-dd5450dbe970

src/tests/asn.1/krb5_encode_test.c
src/tests/asn.1/ktest_equal.c
src/tests/asn.1/trval.c
src/tests/asn.1/utility.c

index a6f8694923b0dd7881c7f15f4c05f56906808441..cbaddd8f937320702c86dc09f4d0ac2fc6644a07 100644 (file)
@@ -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);
index 7f2fa44b1ea09975b0a413543bc216eee08bac3a..c7433255f988097a562175bcf3119f6c467255de 100644 (file)
@@ -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;
index 4506a3f50cfff1c7b49df4929da475354034fbe3..f94459bbf8bcfb7fb168ca102bddf21e4a19bc49 100644 (file)
@@ -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);
                }
index 6ad2e9de857bea2eb1a28c021c5ea7f881337080..19abfbdc332389c3771a2770f3cf36e8b52c3194 100644 (file)
@@ -21,7 +21,7 @@ asn1_error_code asn1_krb5_data_unparse(code, s)
     if(*s==NULL) return ENOMEM;
     strcpy(*s,"<EMPTY>");
   }else{
-    int i;
+    unsigned int i;
 
     *s = (char*)calloc((size_t) 3*(code->length), sizeof(char));
     if(*s == NULL) return ENOMEM;