Re: [BUG] Broken code in orb.c



On 24 January, 1999 - Miguel de Icaza sent me these 0.7K bytes:

> 
> > Well, the code is just wrong ... here's a patch
> > 
> > Regards,
> > -velco--- orb.c.old	Sat Jan 23 03:23:58 1999
> > +++ orb.c	Sat Jan 23 03:25:12 1999
> > @@ -306,8 +306,8 @@
> >  
> > 		  ctmp = g_get_home_dir();
> >  
> > -		buf = alloca(strlen(ctmp) + sizeof("/.orbitrc"));
> > -		sprintf(ctmp, "%s/.orbitrc", buf);
> > +		buf = alloca(strlen(ctmp) + 9 /* strlen("/.orbitrc") */ + 1 );
> > +		sprintf(buf, "%s/.orbitrc", ctmp);
> > 		  ORBit_rc_load(buf, options);
> > 	  }
> 
> I fail to see the problem here.  sizeof ("/.orbitrc") returns 10

Look at the sprintf lines..

/Tomas
-- 
Tomas Ögren, stric@ing.umu.se, http://www.ing.umu.se/~stric/
|- Student of Computer Science at the University of Umeå
`- Sysadmin at {ing,acc}.umu.se



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