I don't think so...  If you look at the prototypes, the check() routine is
passed compressedFormat as a pointer so it can be set and thus check() does
need the *s, but the read() routine is passed the result from check() as a
normal int and does not.


-----Burton

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf
> Of Michal Meloun
> Sent: Sunday, February 01, 2004 4:30 AM
> To: [EMAIL PROTECTED]
> Subject: [Ntop-dev] BUG: Pointer misuse in util.c:checkForInputFile()
>
>
> see patch
> --- util.c.orig       Sun Feb  1 11:17:35 2004
> +++ util.c    Sun Feb  1 11:18:21 2004
> @@ -5520,7 +5520,7 @@
>    for(idx=0; myGlobals.configFileDirs[idx] != NULL; idx++) {
>
>  #ifdef MAKE_WITH_ZLIB
> -      compressedFormat = 1;
> +      *compressedFormat = 1;
>        snprintf(tmpFile, sizeof(tmpFile), "%s/%s.gz",
> myGlobals.configFileDirs
> [idx], fileName);
>        if(logTag != NULL) traceEvent(CONST_TRACE_NOISY, "%s:
> Checking '%s'",
> logTag, tmpFile);
>        fd = gzopen(tmpFile, "r");
> @@ -5528,7 +5528,7 @@
>  #endif
>
>        if(fd == NULL) {
> -     compressedFormat = 0;
> +     *compressedFormat = 0;
>       snprintf(tmpFile, sizeof(tmpFile), "%s/%s", myGlobals.configFileDirs
> [idx], fileName);
>          if(logTag != NULL) traceEvent(CONST_TRACE_NOISY, "%s:
> Checking '%s'",
> logTag, tmpFile);
>       fd = fopen(tmpFile, "r");
> @@ -5558,7 +5558,7 @@
>                         "%s: File '%s' does not need to be reloaded",
>                         logTag, tmpFile);
>  #ifdef MAKE_WITH_ZLIB
> -          if(compressedFormat)
> +          if(*compressedFormat)
>              gzclose(fd);
>            else
>  #endif
>
>
> _______________________________________________
> Ntop-dev mailing list
> [EMAIL PROTECTED]
> http://listgateway.unipi.it/mailman/listinfo/ntop-dev
>

_______________________________________________
Ntop-dev mailing list
[EMAIL PROTECTED]
http://listgateway.unipi.it/mailman/listinfo/ntop-dev

Reply via email to