summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/huffman.c4
-rw-r--r--src/main.c21
2 files changed, 12 insertions, 13 deletions
diff --git a/src/huffman.c b/src/huffman.c
index b751f77..d37ae98 100644
--- a/src/huffman.c
+++ b/src/huffman.c
@@ -1,4 +1,4 @@
-/* huffman compresion based on teeworlds/ddnet huffman */
+/* huffman compresion based on teeworlds/ddnet huffman */
/*{ https://github.com/teeworlds/teeworlds/blob/master/src/engine/shared/huffman.cpp } */
#include "../inc/huffman.h"
@@ -225,7 +225,7 @@ int decompresshuff(const char *inputbuff, int inputsize, char *outputbuff, int o
if (node->symbol == HUFF_EOF_SYMBOL)
return outputlen;
-
+
if (outputlen == outputsize)
return -1;
diff --git a/src/main.c b/src/main.c
index 4356716..e9b5d6c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,5 +1,5 @@
-#include "../inc/huffman.h"
#include "../inc/demo.h"
+#include "../inc/huffman.h"
#include "../inc/pack.h"
#include <stdio.h>
@@ -123,38 +123,37 @@ int main()
int ret = readdemoheader(fp, &dh);
- dm.data = (unsigned char*) malloc(reverseint(dh.mapsize));
+ dm.data = (unsigned char *)malloc(reverseint(dh.mapsize));
printf("\nheader: %i\n", ret);
-
+
if (dh.version >= 4)
ret = readdemotimeline(fp, &dt);
printf("\ntimeline: %i\n", ret);
-
+
// TODO should be able to read 5 aswell, change readdemomap to fit
if (dh.version >= 6)
ret = readdemomap(fp, &dm, reverseint(dh.mapsize));
printf("readdemomap ret: %d\n\n", ret);
-
+
demochunk dc;
int i = 0;
while (readdemochunk(fp, &dc, dh.version) > 0)
{
i++;
- }
+ }
printf("i: %d\n", i);
char c;
do
{
c = getc(fp);
// printf("%x\n", c & 0xff);
- if (c != EOF)
- {
+ if (c != EOF)
+ {
putc(c, op);
}
- }
- while(c != EOF);
+ } while (c != EOF);
return EXIT_SUCCESS;
@@ -165,7 +164,7 @@ int main()
char *line = NULL;
size_t len = 0;
ssize_t nread;
-
+
while ((nread = getline(&line, &len, fp)) != -1)
{
if (testcompress(line) < 0)