nmh-workers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nmh-workers] [PATCH] mhbuild: implement #on/#off/#pop, and the -[no


From: Paul Fox
Subject: Re: [Nmh-workers] [PATCH] mhbuild: implement #on/#off/#pop, and the -[no]directives switch
Date: Thu, 31 May 2012 16:01:30 -0400

ralph wrote:
 > Hi Paul,
 > 
 > > +static void directive_onoff(int onoff)
 > > +{
 > > +    if (directives_index >= sizeof(directives_stack)) {
 > > +  fprintf(stderr, "mhbuild: #on/off overflow, continuing\n");
 > > +  return;
 > > +    }
 > > +    directives_stack[++directives_index] = onoff;
 > > +}
 > 
 > I think the test is wrong.  If 31 >= 32 is false so
 > directives_stack[++31] will be written to.

oops.  you're right.  should be sizeof(directives_stack) - 1.

i thought of using a bitmask instead of that array, but figured
as soon as i did someone would exceed the limit and want it extended.

ken -- i can collect fixes, but it might make more sense for you to.

paul
=---------------------
 paul fox, address@hidden (arlington, ma, where it's 76.3 degrees)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]