Skip to content

Commit

Permalink
fix_DeadCode
Browse files Browse the repository at this point in the history
  • Loading branch information
hanlinbao committed Jul 25, 2024
1 parent 228f789 commit d53f766
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/asn1.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ int asn1_length_from_der(size_t *len, const uint8_t **in, size_t *inlen)
// check if the left input is enough for reading (d,dlen)
if (*inlen < *len) {
error_print();
return -2; // Special error for test_asn1_length() // TODO: fix asn1test.c test vector
return -2; // Special error for test_asn1_length() // TODO: fix asn1test.c test vector
}
return 1;
}
Expand Down Expand Up @@ -411,11 +411,8 @@ int asn1_any_to_der(const uint8_t *a, size_t alen, uint8_t **out, size_t *outlen
}

if (!a) {
if (a) {
error_print();
return -1;
}
return 0;
error_print();
return -1;
}

if (out && *out) {
Expand Down Expand Up @@ -1157,7 +1154,7 @@ int asn1_object_identifier_print(FILE *fp, int format, int indent, const char *l
for (i = 0; i < nodes_cnt - 1; i++) {
fprintf(fp, "%d.", (int)nodes[i]);
}
fprintf(fp, "%d)", nodes[i]);
fprintf(fp, "%d)", (int)nodes[i]);
}
fprintf(fp, "\n");
return 1;
Expand Down

0 comments on commit d53f766

Please sign in to comment.