[haiku-commits] Re: r39990 - haiku/trunk/src/preferences/printers

  • From: Michael Pfeiffer <michael.w.pfeiffer@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 28 Dec 2010 22:22:03 +0100

Am 28.12.2010 um 22:10 schrieb Rene Gollent:

> On Tue, Dec 28, 2010 at 3:49 PM,  <michael.w.pfeiffer@xxxxxxxxx> wrote:
>> -               sprintf(buffer, B_TRANSLATE("%.2f KB"), size / 1024.0);
>> +               snprintf(buffer, sizeof(buffer) - 1, B_TRANSLATE("%.2f KB"),
>> +                       size / 1024.0);
> 
> just FYI, the - 1 is unnecessary, snprintf implicitly reserves one
> byte since it guarantees that the output will be NULL terminated.


Thanks, will remove the -1 soon.
Bye,
Michael

Other related posts: