lkml.org 
[lkml]   [2004]   [Jul]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch] kernel events layer
Keith wrote:
> Never use the return value from snprintf to work out the next buffer
> position, it is not reliable when the data is truncated.

That's why Juergen Quade added scnprintf and vscnprintf to lib/vsprintf.c:

* If you want to have the exact
* number of characters written into @buf as return value
* (not including the trailing '\0'), use vscnprintf.

Andrew wrote:
> A single snprintf here would suit.

As Robert said ... Doh!

--
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <pj@sgi.com> 1.650.933.1373
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:04    [W:0.129 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site