mirror of
https://github.com/mpv-player/mpv
synced 2025-01-01 04:36:24 +01:00
Add zero termination missing in two cases.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28218 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
27fcc9c6a6
commit
67ff2e11b8
@ -53,6 +53,7 @@ play_tree_parser_get_line(play_tree_parser_t* p) {
|
||||
if(p->buffer == NULL) {
|
||||
p->buffer = malloc(BUF_STEP);
|
||||
p->buffer_size = BUF_STEP;
|
||||
p->buffer[0] = 0;
|
||||
p->iter = p->buffer;
|
||||
}
|
||||
|
||||
@ -110,9 +111,9 @@ play_tree_parser_get_line(play_tree_parser_t* p) {
|
||||
if(end[0] != '\0') {
|
||||
p->buffer_end -= end-p->iter;
|
||||
memmove(p->buffer,end,p->buffer_end);
|
||||
p->buffer[p->buffer_end] = '\0';
|
||||
} else
|
||||
p->buffer_end = 0;
|
||||
p->buffer[p->buffer_end] = '\0';
|
||||
p->iter = p->buffer;
|
||||
} else
|
||||
p->iter = end;
|
||||
|
Loading…
Reference in New Issue
Block a user