Description: Fix gzFile type usage Author: Christoph Biedl Bug: https://bitbucket.org/ripencc/bgpdump/issues/32/ Last-Update: 2016-07-20 The gzFile type is already a pointer. Don't pointer it. --- a/cfile_tools.c +++ b/cfile_tools.c @@ -82,7 +82,7 @@ #ifndef DONT_HAVE_GZ if((path == NULL) || (strcmp(path, "-") == 0)) { /* dump from stdin */ - gzFile *f; + gzFile f; while (format < CFR_NUM_FORMATS) { if (strcmp(cfr_extensions[format], ".gz") == 0) break; @@ -157,7 +157,7 @@ #ifndef DONT_HAVE_GZ case 3: // gzip { - gzFile *f; + gzFile f; // get file f = gzopen(path, "r"); if(f == NULL) { @@ -302,8 +302,8 @@ #ifndef DONT_HAVE_GZ case 3: // gzip { - gzFile * in; - in = (gzFile *)(stream->data2); + gzFile in; + in = (gzFile)(stream->data2); retval = gzread(in, ptr, size*nmemb); if (retval != nmemb*size) { // fprintf(stderr,"short read!!!\n"); @@ -391,7 +391,7 @@ #ifndef DONT_HAVE_GZ case 3: // gzip { - char * return_ptr = gzgets((gzFile *)(stream->data2), *lineptr, *n ); + char * return_ptr = gzgets((gzFile)(stream->data2), *lineptr, *n ); if (return_ptr == Z_NULL) { stream->error2 = errno; return(-1); @@ -474,7 +474,7 @@ asprintf(&msg2, "%s: %s", msg, - gzerror((gzFile*)(stream->data2), &(stream->error2))); + gzerror((gzFile)(stream->data2), &(stream->error2))); free(msg); msg = msg2; }