mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
shell.c: fix scan-build NPE warning #8932
This commit is contained in:
parent
93ee31bf65
commit
e30ccd56d9
@ -450,8 +450,8 @@ static void out_data_ring(char *output, size_t size)
|
|||||||
/// @param output Data to append to screen lines.
|
/// @param output Data to append to screen lines.
|
||||||
/// @param remaining Size of data.
|
/// @param remaining Size of data.
|
||||||
/// @param new_line If true, next data output will be on a new line.
|
/// @param new_line If true, next data output will be on a new line.
|
||||||
static void out_data_append_to_screen(char *output, size_t *count,
|
static void out_data_append_to_screen(char *output, size_t *count, bool eof)
|
||||||
bool eof)
|
FUNC_ATTR_NONNULL_ALL
|
||||||
{
|
{
|
||||||
char *p = output, *end = output + *count;
|
char *p = output, *end = output + *count;
|
||||||
while (p < end) {
|
while (p < end) {
|
||||||
@ -491,7 +491,7 @@ static void out_data_cb(Stream *stream, RBuffer *buf, size_t count, void *data,
|
|||||||
&& out_data_decide_throttle(cnt)) { // Skip output above a threshold.
|
&& out_data_decide_throttle(cnt)) { // Skip output above a threshold.
|
||||||
// Save the skipped output. If it is the final chunk, we display it later.
|
// Save the skipped output. If it is the final chunk, we display it later.
|
||||||
out_data_ring(ptr, cnt);
|
out_data_ring(ptr, cnt);
|
||||||
} else {
|
} else if (ptr != NULL) {
|
||||||
out_data_append_to_screen(ptr, &cnt, eof);
|
out_data_append_to_screen(ptr, &cnt, eof);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user