mirror of
https://github.com/libretro/RetroArch
synced 2025-01-31 06:32:48 +00:00
Cleanup print_buff_lines
This commit is contained in:
parent
4e8020bf90
commit
8b086d0cc5
@ -2163,12 +2163,17 @@ static void print_buf_lines(file_list_t *list, char *buf, int buf_size,
|
||||
|
||||
for (i = 0; i < buf_size; i++)
|
||||
{
|
||||
if (*(buf + i) == '\n')
|
||||
{
|
||||
/* Found a line ending, print the line and compute new line_start */
|
||||
|
||||
size_t ln;
|
||||
|
||||
/* The end of the buffer, print the last bit */
|
||||
if (*(buf + i) == '\0')
|
||||
break;
|
||||
|
||||
if (*(buf + i) != '\n')
|
||||
continue;
|
||||
|
||||
/* Found a line ending, print the line and compute new line_start */
|
||||
|
||||
/* Save the next char */
|
||||
c = *(buf + i + 1);
|
||||
/* replace with \0 */
|
||||
@ -2186,12 +2191,6 @@ static void print_buf_lines(file_list_t *list, char *buf, int buf_size,
|
||||
*(buf + i + 1) = c;
|
||||
line_start = buf + i + 1;
|
||||
}
|
||||
else if (*(buf + i) == '\0')
|
||||
{
|
||||
/* The end of the buffer, print the last bit */
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* If the buffer was completely full, and didn't end with a newline, just
|
||||
* ignore the partial last line.
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user