aboutsummaryrefslogtreecommitdiffstats
path: root/libtests/hex.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libtests/hex.cc')
-rw-r--r--libtests/hex.cc22
1 files changed, 8 insertions, 14 deletions
diff --git a/libtests/hex.cc b/libtests/hex.cc
index 0480c7ea..9e708204 100644
--- a/libtests/hex.cc
+++ b/libtests/hex.cc
@@ -4,33 +4,27 @@
#include <iostream>
#include <stdlib.h>
-int main()
+int
+main()
{
Pl_StdioFile out("stdout", stdout);
Pl_ASCIIHexDecoder decode("decode", &out);
- try
- {
+ try {
unsigned char buf[10000];
bool done = false;
- while (! done)
- {
+ while (!done) {
size_t len = fread(buf, 1, sizeof(buf), stdin);
- if (len <= 0)
- {
+ if (len <= 0) {
done = true;
- }
- else
- {
+ } else {
decode.write(buf, len);
}
}
decode.finish();
- }
- catch (std::exception& e)
- {
+ } catch (std::exception& e) {
std::cerr << e.what() << std::endl;
- exit(2);
+ exit(2);
}
return 0;