Commit fb35e088 authored by Lev Walkin's avatar Lev Walkin

whitespace changes

parent d19216f2
......@@ -276,8 +276,8 @@ main(int ac, char *av[]) {
/*
* Decode the encoded structure from file.
*/
structure = data_decode_from_file(pduType,
file, name, suggested_bufsize, first_pdu);
structure = data_decode_from_file(pduType, file, name,
suggested_bufsize, first_pdu);
if(!structure) {
if(errno) {
/* Error message is already printed */
......@@ -292,10 +292,11 @@ main(int ac, char *av[]) {
if(opt_check) {
char errbuf[128];
size_t errlen = sizeof(errbuf);
if(asn_check_constraints(pduType, structure,
errbuf, &errlen)) {
fprintf(stderr, "%s: ASN.1 constraint "
"check failed: %s\n", name, errbuf);
if(asn_check_constraints(pduType, structure, errbuf, &errlen)) {
fprintf(stderr,
"%s: ASN.1 constraint "
"check failed: %s\n",
name, errbuf);
exit(EX_DATAERR);
}
}
......@@ -312,18 +313,16 @@ main(int ac, char *av[]) {
break;
case OUT_XER: /* -oxer */
if(xer_fprint(stdout, pduType, structure)) {
fprintf(stderr,
"%s: Cannot convert %s into XML\n",
name, pduType->name);
fprintf(stderr, "%s: Cannot convert %s into XML\n", name,
pduType->name);
exit(EX_UNAVAILABLE);
}
break;
case OUT_DER:
erv = der_encode(pduType, structure, write_out, stdout);
if(erv.encoded < 0) {
fprintf(stderr,
"%s: Cannot convert %s into DER\n",
name, pduType->name);
fprintf(stderr, "%s: Cannot convert %s into DER\n", name,
pduType->name);
exit(EX_UNAVAILABLE);
}
DEBUG("Encoded in %ld bytes of DER", (long)erv.encoded);
......@@ -331,9 +330,8 @@ main(int ac, char *av[]) {
case OUT_OER:
erv = oer_encode(pduType, structure, write_out, stdout);
if(erv.encoded < 0) {
fprintf(stderr,
"%s: Cannot convert %s into oER\n",
name, pduType->name);
fprintf(stderr, "%s: Cannot convert %s into oER\n", name,
pduType->name);
exit(EX_UNAVAILABLE);
}
DEBUG("Encoded in %ld bytes of OER", (long)erv.encoded);
......@@ -342,8 +340,8 @@ main(int ac, char *av[]) {
erv = uper_encode(pduType, structure, write_out, stdout);
if(erv.encoded < 0) {
fprintf(stderr,
"%s: Cannot convert %s into Unaligned PER\n",
name, pduType->name);
"%s: Cannot convert %s into Unaligned PER\n", name,
pduType->name);
exit(EX_UNAVAILABLE);
}
DEBUG("Encoded in %ld bits of UPER", (long)erv.encoded);
......@@ -353,10 +351,11 @@ main(int ac, char *av[]) {
ASN_STRUCT_FREE(*pduType, structure);
}
if(file && file != stdin)
if(file && file != stdin) {
fclose(file);
}
}
}
#ifdef JUNKTEST
if(opt_jprob > 0.0) {
......@@ -816,15 +815,11 @@ static int argument_is_stdin(char *av[], int idx) {
}
static FILE *argument_to_file(char *av[], int idx) {
return argument_is_stdin(av, idx)
? stdin
: fopen(av[idx], "rb");
return argument_is_stdin(av, idx) ? stdin : fopen(av[idx], "rb");
}
static char *argument_to_name(char *av[], int idx) {
return argument_is_stdin(av, idx)
? "standard input"
: av[idx];
return argument_is_stdin(av, idx) ? "standard input" : av[idx];
}
#ifdef JUNKTEST
......@@ -854,8 +849,7 @@ junk_bytes_with_probability(uint8_t *buf, size_t size, double prob) {
byte ^= BPROB(0x01);
}
if(byte != *ptr) {
DEBUG("Junk buf[%d] %02x -> %02x",
ptr - buf, *ptr, byte);
DEBUG("Junk buf[%d] %02x -> %02x", ptr - buf, *ptr, byte);
*ptr = byte;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment