Skip to content

Commit

Permalink
%x expects an unsigned int, but unsigned char is promoted to int
Browse files Browse the repository at this point in the history
  • Loading branch information
pascal-cuoq committed Apr 2, 2016
1 parent bd6f377 commit 0803a38
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/structure.c
Expand Up @@ -834,7 +834,7 @@ asn1_print_structure (FILE * out, asn1_node structure, const char *name,
fprintf (out, " value:0x");
if (len > 0)
for (k = 0; k < len; k++)
fprintf (out, "%02x", (p->value)[k + len2]);
fprintf (out, "%02x", (unsigned) (p->value)[k + len2]);
}
break;
case ASN1_ETYPE_ENUMERATED:
Expand All @@ -845,7 +845,7 @@ asn1_print_structure (FILE * out, asn1_node structure, const char *name,
fprintf (out, " value:0x");
if (len > 0)
for (k = 0; k < len; k++)
fprintf (out, "%02x", (p->value)[k + len2]);
fprintf (out, "%02x", (unsigned) (p->value)[k + len2]);
}
break;
case ASN1_ETYPE_BOOLEAN:
Expand All @@ -867,7 +867,7 @@ asn1_print_structure (FILE * out, asn1_node structure, const char *name,
fprintf (out, " value(%i):",
(len - 1) * 8 - (p->value[len2]));
for (k = 1; k < len; k++)
fprintf (out, "%02x", (p->value)[k + len2]);
fprintf (out, "%02x", (unsigned) (p->value)[k + len2]);
}
}
break;
Expand Down Expand Up @@ -907,7 +907,7 @@ asn1_print_structure (FILE * out, asn1_node structure, const char *name,
fprintf (out, " value:");
if (len > 0)
for (k = 0; k < len; k++)
fprintf (out, "%02x", (p->value)[k + len2]);
fprintf (out, "%02x", (unsigned) (p->value)[k + len2]);
}
break;
case ASN1_ETYPE_OBJECT_ID:
Expand All @@ -922,7 +922,7 @@ asn1_print_structure (FILE * out, asn1_node structure, const char *name,
fprintf (out, " value:");
if (len2 > 0)
for (k = 0; k < len2; k++)
fprintf (out, "%02x", (p->value)[k + len3]);
fprintf (out, "%02x", (unsigned) (p->value)[k + len3]);
}
break;
case ASN1_ETYPE_SET:
Expand Down

0 comments on commit 0803a38

Please sign in to comment.