Permalink
Browse files

Fix off by one error

Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
  • Loading branch information...
jdieter committed Jan 24, 2019
1 parent 168cc11 commit 0f196dcbe94b35f7ee9a499574e14d4e512e5408
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/unzck.c
@@ -129,9 +129,9 @@ int main (int argc, char *argv[]) {
char *base_name = basename(arguments.args[0]);
char *out_name = NULL;
if(arguments.dict)
out_name = calloc(strlen(base_name) + 2, 1); // len .zck -> .zdict = +2
out_name = calloc(strlen(base_name) + 3, 1); // len .zck -> .zdict = +2
else
out_name = calloc(strlen(base_name) - 3, 1);
out_name = calloc(strlen(base_name) - 2, 1);
assert(out_name);
snprintf(out_name, strlen(base_name) - 3, "%s", base_name); //Strip off .zck
if(arguments.dict)

0 comments on commit 0f196dc

Please sign in to comment.