Skip to content

Commit

Permalink
Work around what gcc considers an undefined behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
jedisct1 committed Jan 5, 2015
1 parent 8cc4729 commit 7eb7f77
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cert.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ cert_display_txt_record_tinydns(struct SignedCert *signed_cert)

fputs("'2.dnscrypt-cert:", stdout);
while (i < sizeof(struct SignedCert)) {
c = (int)*(signed_cert->magic_cert + i);
c = (int)*((const uint8_t *) signed_cert + i);
if (isprint(c) && c != ':' && c != '\\' && c != '&' && c != '<'
&& c != '>') {
putchar(c);
Expand All @@ -98,7 +98,7 @@ cert_display_txt_record(struct SignedCert *signed_cert)

fputs("2.dnscrypt-cert\t86400\tIN\tTXT\t\"", stdout);
while (i < sizeof(struct SignedCert)) {
c = (int)*(signed_cert->magic_cert + i);
c = (int)*((const uint8_t *) signed_cert + i);
if (isprint(c) && c != '"' && c != '\\') {
putchar(c);
} else {
Expand Down

0 comments on commit 7eb7f77

Please sign in to comment.