> > *** fe-exec.c       2001/01/24 19:43:30     1.98
> > --- fe-exec.c       2001/02/06 02:02:27     1.100
> > ***************
> > *** 2035,2041 ****
> >     if (len > 23)
> >             len = 23;
> >     strncpy(buf, res->cmdStatus + 7, len);
> > !   buf[23] = '\0';
> >   
> >     return buf;
> >   }
> > --- 2035,2041 ----
> >     if (len > 23)
> >             len = 23;
> >     strncpy(buf, res->cmdStatus + 7, len);
> > !   buf[len] = '\0';
> >   
> >     return buf;
> >   }
> > 
> 
> Hmm, is there some undocumented feature of strncpy that I don't know
> about, where it modifies the passed length variable (which would be hard,
> since it's pass by value)? Otherwise, doesn't this patch just replace
> the constant '23' with the variable 'len', set to 23?

What if len < 23?

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  [EMAIL PROTECTED]               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Reply via email to