diff --git a/src/screen_help.c b/src/screen_help.c
index 80495a297eb84f5b3afacc285179096e1fa9255a..2b5dc1f162329ef7968e52f6dc242556afe28ed2 100644 (file)
--- a/src/screen_help.c
+++ b/src/screen_help.c
*
*/
-#include <stdlib.h>
-#include <string.h>
-#include <glib.h>
-#include <ncurses.h>
-
#include "config.h"
#include "ncmpc.h"
#include "mpdclient.h"
#include "screen.h"
#include "screen_utils.h"
+#include <stdlib.h>
+#include <string.h>
+#include <glib.h>
+#include <ncurses.h>
+
typedef struct {
signed char highlight;
static const char *
-list_callback(int index, int *highlight, void *data)
+list_callback(int idx, int *highlight, void *data)
{
static char buf[512];
}
*highlight = 0;
- if (index < help_text_rows) {
- *highlight = help_text[index].highlight > 0;
- if (help_text[index].command == CMD_NONE) {
- if (help_text[index].text)
- g_snprintf(buf, sizeof(buf), " %s", _(help_text[index].text));
- else if (help_text[index].highlight == 2) {
+ if (idx < help_text_rows) {
+ *highlight = help_text[idx].highlight > 0;
+ if (help_text[idx].command == CMD_NONE) {
+ if (help_text[idx].text)
+ g_snprintf(buf, sizeof(buf), " %s", _(help_text[idx].text));
+ else if (help_text[idx].highlight == 2) {
int i;
for (i = 3; i < COLS - 3 && i < sizeof(buf); i++)
return buf;
}
- if (help_text[index].text)
+ if (help_text[idx].text)
g_snprintf(buf, sizeof(buf),
"%20s : %s ",
- get_key_names(help_text[index].command, TRUE),
- _(help_text[index].text));
+ get_key_names(help_text[idx].command, TRUE),
+ _(help_text[idx].text));
else
g_snprintf(buf, sizeof(buf),
"%20s : %s ",
- get_key_names(help_text[index].command, TRUE),
- get_key_description(help_text[index].command));
+ get_key_names(help_text[idx].command, TRUE),
+ get_key_description(help_text[idx].command));
return buf;
}