lkml.org 
[lkml]   [2020]   [Aug]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH][v2] proc: use vmalloc for our kernel buffer
From
Date
On 8/13/20 5:10 PM, David Laight wrote:
> From: Josef Bacik
>> Sent: 13 August 2020 18:19
> ...
>> We wouldn't even need the extra +1 part, since we're only copying in how much
>> the user wants anyway, we could just go ahead and convert this to
>>
>> left -= snprintf(buffer, left, "0x%04x\n", *(unsigned int *) table->data);
>>
>> and be fine, right? Or am I misunderstanding what you're looking for? Thanks,
>
> Doesn't that need to be scnprintf()?
> IIRC snprintf() returns the number of bytes that would have been
> written were the buffer infinite size?
> (I suspect this is an 'accidental' return value from the original
> SYSV? userspace implementation that just dumped characters that
> wouldn't fit in the buffer somewhere.)
>

Yeah, if you look at the patches I just sent you'll notice I used scnprintf()
everywhere. Thanks,

Josef

\
 
 \ /
  Last update: 2020-08-13 23:33    [W:0.044 / U:1.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site