read_line() always null-terminates string
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2481 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
bde60b66d1
commit
51159b0e8c
1 changed files with 2 additions and 0 deletions
|
@ -483,6 +483,8 @@ static int read_line(int fd, char* buffer, int buffer_size)
|
||||||
|
|
||||||
if ( count < buffer_size )
|
if ( count < buffer_size )
|
||||||
buffer[count] = 0;
|
buffer[count] = 0;
|
||||||
|
else
|
||||||
|
buffer[buffer_size-1] = 0;
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue