clang detected the following false positive: sort.c:2435:15: warning: Null pointer passed as an argument to a 'nonnull' parameter memcpy (saved.text, smallest->text, saved.length); ^ ~~~~~~~~~~
When we reach this line saved.text is guaranteed to be non null. Signed-off-by: Kovarththanan Rajaratnam <kovarththanan.rajarat...@gmail.com> --- src/sort.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/sort.c b/src/sort.c index b50f6cd..010930b 100644 --- a/src/sort.c +++ b/src/sort.c @@ -2432,6 +2432,7 @@ mergefps (struct sortfile *files, size_t ntemps, size_t nfiles, saved.text = xrealloc (saved.text, savealloc); } saved.length = smallest->length; + assert(saved.text); memcpy (saved.text, smallest->text, saved.length); if (key) { -- 1.6.3.3