Skip to content

Commit

Permalink
Fixed unwanted added characters to the HTML output.
Browse files Browse the repository at this point in the history
  • Loading branch information
allinurl committed Aug 26, 2019
1 parent 5d37e57 commit 978dc99
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/bin2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
* I have decided not to change the licence.
*/

#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <string.h>

#ifdef USE_BZ2
#include <bzlib.h>
Expand Down Expand Up @@ -46,7 +46,6 @@ main (int argc, char *argv[])
fseek (f_input, 0, SEEK_END);
file_size = ftell (f_input);
fseek (f_input, 0, SEEK_SET);
file_size++;

if ((buf = malloc (file_size)) == NULL) {
fprintf (stderr, "Unable to malloc bin2c.c buffer\n");
Expand All @@ -59,7 +58,7 @@ main (int argc, char *argv[])

#ifdef USE_BZ2
// allocate for bz2.
bz2_size = ((file_size) * 1.01) + 600; // as per the documentation
bz2_size = (file_size + file_size / 100 + 1) + 600; // as per the documentation

if ((bz2_buf = malloc (bz2_size)) == NULL) {
fprintf (stderr, "Unable to malloc bin2c.c buffer\n");
Expand Down

0 comments on commit 978dc99

Please sign in to comment.