Permalink
Browse files

buffer size cleanups

Patch by: michaelortmann
  • Loading branch information...
michaelortmann authored and vanosg committed Nov 2, 2018
1 parent 2b4f0c7 commit 40d9f39c5836ce8b0ebe7e0c84c5cd908635d4ba
Showing with 8 additions and 8 deletions.
  1. +8 −8 src/mod/compress.mod/compress.c
@@ -296,14 +296,14 @@ static int compress_to_file(char *f_src, char *f_target, int mode_num)
*/
static int compress_file(char *filename, int mode_num)
{
char *temp_fn, randstr[5];
char *temp_fn, rands[8];
int ret;
/* Create temporary filename. */
temp_fn = nmalloc(strlen(filename) + 5);
make_rand_str(randstr, 4);
temp_fn = nmalloc(strlen(filename) + sizeof rands);
make_rand_str(rands, sizeof rands - 1);
strcpy(temp_fn, filename);
strcat(temp_fn, randstr);
strcat(temp_fn, rands);
/* Compress file. */
ret = compress_to_file(filename, temp_fn, mode_num);
@@ -322,14 +322,14 @@ static int compress_file(char *filename, int mode_num)
*/
static int uncompress_file(char *filename)
{
char *temp_fn, randstr[5];
char *temp_fn, rands[8];
int ret;
/* Create temporary filename. */
temp_fn = nmalloc(strlen(filename) + 5);
make_rand_str(randstr, 4);
temp_fn = nmalloc(strlen(filename) + sizeof rands);
make_rand_str(rands, sizeof rands - 1);
strcpy(temp_fn, filename);
strcat(temp_fn, randstr);
strcat(temp_fn, rands);
/* Uncompress file. */
ret = uncompress_to_file(filename, temp_fn);

0 comments on commit 40d9f39

Please sign in to comment.