httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Slemko <ma...@znep.com>
Subject Re: [BUG]: "syntax error in mod_rewrite.c" on Solaris 2.x
Date Thu, 06 Feb 1997 05:18:13 GMT
Done.  I still think the sizeof() one was better.. err.. worse.  <g>

On Wed, 5 Feb 1997, Ralf S. Engelschall wrote:

> 
> In article <Pine.BSF.3.91.970205023704.210C-100000@localhost.imdb.com> you wrote:
> > On Tue, 4 Feb 1997 lawrence@pacific.net.sg wrote:
> 
> > > Submitter: lawrence@pacific.net.sg
> > > Operating system: Solaris 2.x, version: 
> > > Version of Apache Used: 1.2b6
> > > Extra Modules used: 
> > > URL exhibiting problem: 
> > > 
> > > Symptoms:
> > > --
> > > Line 2105:
> > > dbmkey.dsize = strlen(key) < sizeof(buf) - 1 : strlen(key) ? sizeof(buf)-1;
> > > 
> > > Should read as:
> > > dbmkey.dsize = strlen(key) < sizeof(buf) - 1 ? strlen(key) : sizeof(buf)-1;
> 
> > Good catch.
> 
> Huaaah! What a silly syntax mistake from Marc and me. Thanks for the hint. Was
> recently broken when we introduce the snprintf-patches. Seems like gcc -Wall
> is not as good as it should ;-) I've fixed this in my version (still named
> 3.0.0 because not yet released), so please commit the following patch to the
> CVS:
> 
> *** mod_rewrite.c.OLD	Wed Feb  5 11:24:30 1997
> --- mod_rewrite.c	Wed Feb  5 11:20:27 1997
> ***************
> *** 2165,2171 ****
>       char buf[MAX_STRING_LEN];
>   
>       dbmkey.dptr  = key;
> !     dbmkey.dsize = (strlen(key) < sizeof(buf) - 1 : strlen(key) ? sizeof(buf)-1);
>       if ((dbmfp = dbm_open(file, O_RDONLY, 0666)) != NULL) {
>           dbmval = dbm_fetch(dbmfp, dbmkey);
>           if (dbmval.dptr != NULL) {
> --- 2165,2171 ----
>       char buf[MAX_STRING_LEN];
>   
>       dbmkey.dptr  = key;
> !     dbmkey.dsize = (strlen(key) < sizeof(buf) - 1 ? strlen(key) : sizeof(buf)-1);
>       if ((dbmfp = dbm_open(file, O_RDONLY, 0666)) != NULL) {
>           dbmval = dbm_fetch(dbmfp, dbmkey);
>           if (dbmval.dptr != NULL) {
> 
> 
> Thanks.
>                                        Ralf S. Engelschall
>                                        rse@engelschall.com
>                                        www.engelschall.com
> 


Mime
View raw message