aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2018-08-29 22:00:38 +0200
committerGitHub <noreply@github.com>2018-08-29 22:00:38 +0200
commite30ccd56d9543afd5e66feec984a9dc8bc6be38e (patch)
tree73a6ebcd668087ae59a17dabfef0b17e982f42c4 /src
parent93ee31bf650a74c2e4cc60897210c9175ab11e4d (diff)
downloadrneovim-e30ccd56d9543afd5e66feec984a9dc8bc6be38e.tar.gz
rneovim-e30ccd56d9543afd5e66feec984a9dc8bc6be38e.tar.bz2
rneovim-e30ccd56d9543afd5e66feec984a9dc8bc6be38e.zip
shell.c: fix scan-build NPE warning #8932
Diffstat (limited to 'src')
-rw-r--r--src/nvim/os/shell.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/os/shell.c b/src/nvim/os/shell.c
index 04f59d7522..bd1e99cc8e 100644
--- a/src/nvim/os/shell.c
+++ b/src/nvim/os/shell.c
@@ -450,8 +450,8 @@ static void out_data_ring(char *output, size_t size)
/// @param output Data to append to screen lines.
/// @param remaining Size of data.
/// @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,
- bool eof)
+static void out_data_append_to_screen(char *output, size_t *count, bool eof)
+ FUNC_ATTR_NONNULL_ALL
{
char *p = output, *end = output + *count;
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.
// Save the skipped output. If it is the final chunk, we display it later.
out_data_ring(ptr, cnt);
- } else {
+ } else if (ptr != NULL) {
out_data_append_to_screen(ptr, &cnt, eof);
}