From 47f66e49a753d7a06c16b0cd35715e11c3e54497 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Fri, 12 Jul 2019 16:24:27 -0700 Subject: [PATCH] Added fallback for if binding has no description. --- bb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bb.c b/bb.c index 982be2e..91258e2 100644 --- a/bb.c +++ b/bb.c @@ -1382,7 +1382,8 @@ void print_bindings(int fd) *p = '\0'; sprintf(buf2, "\033[1m\033[%dG%s\033[0m", termwidth/2 - 1 - (int)strlen(buf), buf); write(fd, buf2, strlen(buf2)); - sprintf(buf2, "\033[0m\033[%dG\033[34m%s\033[0m", termwidth/2 + 1, bindings[i].description); + sprintf(buf2, "\033[0m\033[%dG\033[34m%s\033[0m", termwidth/2 + 1, + bindings[i].description ? bindings[i].description : bindings[i].script); write(fd, buf2, strlen(buf2)); write(fd, "\033[0m\n", strlen("\033[0m\n")); }