Write int, short int or any integer value in a file in binary form using fputc
Using malloc() and free() in readListPos() seems like overkill. You could use:

short s;
char *posChar = (char *)&amp;s;

for (int i = 0; i &lt; sizeof(s); i++)
{
    int c;
    if ((c = fgetc(comp-&gt;inputFile)) == EOF)
        …handle EOF…
    *posChar++ = c;
}
return s;


Note that this code handles EOF, unlike the original; you must always error check your inputs.

This code matches the code that writes the data.  It is, however, tied to a particular endian-ness; the written data is not portable between, say, an Intel machine and a SPARC or PowerPC machine.  If that doesn't matter to you, then you're more or less OK.

For non-portable reading and writing of binary data, the fread() and fwrite() functions are simpler.

Reading:

short s;
if (fread(&amp;s, sizeof(s), 1, comp-&gt;inputFile) != 1)
    …process error/EOF…
return s;


Writing:

if (fwrite(&amp;listPos, sizeof(listPos), 1, comp-&gt;outputFile) != 1)
    …process error…


If you're doing it portably, you define whether the number is written big endian or little endian and then write the bytes in that order on both big endian and little endian machines.  (If you can demonstrate it's a performance problem, you can optimize one of the two platform types, but it complicates the code for what is usually negligible benefit.  ('Premature optimization is the root of all evil.')