lkml.org 
[lkml]   [2015]   [Sep]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] kernel/sysctl.c: If "count" including the terminating byte '\0' the write system call should retrun success.
On Sun, 13 Sep 2015 20:39:31 +0800
Sean Fu <fxinrong@gmail.com> wrote:


> > Accepting a '\0' is not at all reasonable for a text interface. The
> > application that does it is buggy.
> It is hard to comprehend that the current kernel can accept two bytes
> "1 ", "1\t", "1\n" except "1\0".

Um, it does not seem hard to comprehend at all. As this is a string,
and it acts the same as a printf() or strlen.

strlen("1 ") == 2
strlen("1\t") == 2
strlen("1\n") == 2
strlen("1\0") == 1

Big difference to me.

-- Steve



\
 
 \ /
  Last update: 2015-09-13 22:21    [W:0.126 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site