summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/source/Host/common/Editline.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lldb/source/Host/common/Editline.cpp b/lldb/source/Host/common/Editline.cpp
index da83de656df..aa52b4ca4f0 100644
--- a/lldb/source/Host/common/Editline.cpp
+++ b/lldb/source/Host/common/Editline.cpp
@@ -870,10 +870,11 @@ static void PrintCompletion(FILE *output_file, size_t start, size_t end,
const char *completion_str = completions.GetStringAtIndex(i);
const char *description_str = descriptions.GetStringAtIndex(i);
- fprintf(output_file, "\n\t%-*s", max_len, completion_str);
+ if (completion_str)
+ fprintf(output_file, "\n\t%-*s", max_len, completion_str);
// Print the description if we got one.
- if (strlen(description_str))
+ if (description_str && strlen(description_str))
fprintf(output_file, " -- %s", description_str);
}
}
OpenPOWER on IntegriCloud