Skip to content

Instantly share code, notes, and snippets.

@AtnNn
Created November 3, 2013 19:50
Show Gist options
  • Save AtnNn/7294047 to your computer and use it in GitHub Desktop.
Save AtnNn/7294047 to your computer and use it in GitHub Desktop.
diff --git a/src/clustering/administration/cli/admin_command_parser.cc b/src/clustering/administration/cli/admin_command_parser.cc
index 453eb0d..4d0d260 100644
--- a/src/clustering/administration/cli/admin_command_parser.cc
+++ b/src/clustering/administration/cli/admin_command_parser.cc
@@ -344,7 +344,8 @@ admin_command_parser_t::admin_term_cap_t::admin_term_cap_t(fd_t fd) {
}
// Command to disable all formatting
- char *normal_cstr = tgetstr("me", NULL);
+ char end_modes[] = "me";
+ char *normal_cstr = tgetstr(end_modes, NULL);
if (normal_cstr != NULL) {
normal_str.assign(normal_cstr);
} else {
@@ -353,13 +354,15 @@ admin_command_parser_t::admin_term_cap_t::admin_term_cap_t(fd_t fd) {
}
// Command to enable double-bright mode (bold)
- char *bold_cstr = tgetstr("md", NULL);
+ char bold_mode[] = "md";
+ char *bold_cstr = tgetstr(bold_mode, NULL);
if (bold_cstr != NULL) {
bold_str.assign(bold_cstr);
}
// Command to enable underline mode
- char *underline_cstr = tgetstr("us", NULL);
+ char underline_mode[] = "us";
+ char *underline_cstr = tgetstr(underline_mode, NULL);
if (underline_cstr != NULL) {
underline_str.assign(underline_cstr);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment