From: Laurent Mazet Date: Fri, 9 Dec 2022 13:45:37 +0000 (+0100) Subject: cleaning and bug fix X-Git-Url: https://secure.softndesign.org/git/?p=compress.git;a=commitdiff_plain;h=125462cff18fd1757ca467214d9c21808f02a8e1 cleaning and bug fix --- diff --git a/compress.c b/compress.c index ea65038..713fc5b 100644 --- a/compress.c +++ b/compress.c @@ -27,7 +27,6 @@ char *progname = NULL; int usage (int ret) { - //int fd = ret ? STDERR_FILENO : STDOUT_FILENO; int fd = ret ? _fderr : _fdout; fdprintf (fd, "usage: %s\n", progname); fdprintf (fd, " -h : help message\n"); @@ -38,14 +37,8 @@ int usage (int ret) return ret; } -void blkcpy (void *dst, const void *src, int len) -{ - while (len--) { - *((char *)dst++) = *((char *)src++); - } -} - /* create occurence table */ + int *create_table (char *filename) { byte_t buffer[BUFFER_SIZE] = {0}; @@ -58,7 +51,7 @@ int *create_table (char *filename) /* open file */ fid = open (filename, O_RDONLY|O_RAW); if (fid == -1) { - VERBOSE (ERROR, PRINTERR ("can't open file '%s'\n", filename/); + VERBOSE (ERROR, PRINTERR ("can't open file '%s'\n", filename)); return NULL; } VERBOSE (INFO, PRINTOUT ("file '%s' opened\n", filename));