diff options
author | Kalle Wallin <kaw@linux.se> | 2004-07-13 21:10:06 +0000 |
---|---|---|
committer | Kalle Wallin <kaw@linux.se> | 2004-07-13 21:10:06 +0000 |
commit | 9a500d13055f16b70796a5fce5ec6de4a2844187 (patch) | |
tree | 8f57c14c8454ee836597cc47ed7eedd3b6f4dabe /src/screen_help.c | |
parent | e9f21b11c862ad168bb5a850730861e01ad6f3d8 (diff) | |
download | mpd-9a500d13055f16b70796a5fce5ec6de4a2844187.tar.gz mpd-9a500d13055f16b70796a5fce5ec6de4a2844187.tar.xz mpd-9a500d13055f16b70796a5fce5ec6de4a2844187.zip |
Use glib's str functions (g_strlcat, g_strlcpy, g_snprintf, g_strdup_vprintf)
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1868 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/screen_help.c')
-rw-r--r-- | src/screen_help.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/screen_help.c b/src/screen_help.c index 68021c651..94fe9ab5b 100644 --- a/src/screen_help.c +++ b/src/screen_help.c @@ -121,7 +121,7 @@ static list_window_t *lw = NULL; static char * list_callback(int index, int *highlight, void *data) { - static char buf[256]; + static char buf[512]; if( help_text_rows<0 ) { @@ -137,30 +137,30 @@ list_callback(int index, int *highlight, void *data) if( help_text[index].command == CMD_NONE ) { if( help_text[index].text ) - snprintf(buf, 256, "%28s", _(help_text[index].text)); + g_snprintf(buf, sizeof(buf), "%28s", _(help_text[index].text)); else if( help_text[index].highlight == 2 ) { int i; - for(i=3; i<COLS-3 && i<256; i++) + for(i=3; i<COLS-3 && i<sizeof(buf); i++) buf[i]='-'; buf[i] = '\0'; } else - strcpy(buf, " "); + g_strlcpy(buf, " ", sizeof(buf)); return buf; } if( help_text[index].text ) - snprintf(buf, 256, - "%20s : %s ", - get_key_names(help_text[index].command, TRUE), - _(help_text[index].text)); + g_snprintf(buf, sizeof(buf), + "%20s : %s ", + get_key_names(help_text[index].command, TRUE), + _(help_text[index].text)); else - snprintf(buf, 256, - "%20s : %s ", - get_key_names(help_text[index].command, TRUE), - get_key_description(help_text[index].command)); + g_snprintf(buf, sizeof(buf), + "%20s : %s ", + get_key_names(help_text[index].command, TRUE), + get_key_description(help_text[index].command)); return buf; } |