Source-Changes-D archive

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

Re: CVS commit: src/sys/dev/pci



On Nov 2,  8:49am, paul%whooppee.com@localhost (Paul Goyette) wrote:
-- Subject: Re: CVS commit: src/sys/dev/pci

| > Why *len = 1 here? Shouldn't it be 0 since there is no more room left?
| 
| No.  :)
| 
| The maximum number of characters actually written by vsnprintf() will 
| never exceed (len - 1).  So, dest gets incremented by the max, and len 
| gets decremented by the max.
| 
| There is always enough room left for vsnprintf() to create a new 
| trailing NUL.

But that's doing extra work for no reason...

christos


Home | Main Index | Thread Index | Old Index