diff options
Diffstat (limited to 'apps/gui/gwps-common.c')
-rw-r--r-- | apps/gui/gwps-common.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c index f480f616a2..c0923a9ab5 100644 --- a/apps/gui/gwps-common.c +++ b/apps/gui/gwps-common.c | |||
@@ -659,8 +659,7 @@ static char* get_dir(char* buf, int buf_size, const char* path, int level) | |||
659 | return NULL; | 659 | return NULL; |
660 | 660 | ||
661 | len = MIN(last_sep - sep, buf_size - 1); | 661 | len = MIN(last_sep - sep, buf_size - 1); |
662 | strncpy(buf, sep + 1, len); | 662 | strlcpy(buf, sep + 1, len + 1); |
663 | buf[len] = 0; | ||
664 | return buf; | 663 | return buf; |
665 | } | 664 | } |
666 | 665 | ||
@@ -1183,12 +1182,12 @@ static const char *get_token_value(struct gui_wps *gwps, | |||
1183 | { | 1182 | { |
1184 | /* we need 11 characters (full line) for | 1183 | /* we need 11 characters (full line) for |
1185 | progress-bar */ | 1184 | progress-bar */ |
1186 | strncpy(buf, " ", buf_size); | 1185 | strlcpy(buf, " ", buf_size); |
1187 | } | 1186 | } |
1188 | else | 1187 | else |
1189 | { | 1188 | { |
1190 | /* Tell the user if we have an OldPlayer */ | 1189 | /* Tell the user if we have an OldPlayer */ |
1191 | strncpy(buf, " <Old LCD> ", buf_size); | 1190 | strlcpy(buf, " <Old LCD> ", buf_size); |
1192 | } | 1191 | } |
1193 | return buf; | 1192 | return buf; |
1194 | #endif | 1193 | #endif |
@@ -1254,11 +1253,11 @@ static const char *get_token_value(struct gui_wps *gwps, | |||
1254 | break; | 1253 | break; |
1255 | case 2: | 1254 | case 2: |
1256 | case 4: | 1255 | case 4: |
1257 | strncpy(buf, id3->track_gain_string, buf_size); | 1256 | strlcpy(buf, id3->track_gain_string, buf_size); |
1258 | break; | 1257 | break; |
1259 | case 3: | 1258 | case 3: |
1260 | case 5: | 1259 | case 5: |
1261 | strncpy(buf, id3->album_gain_string, buf_size); | 1260 | strlcpy(buf, id3->album_gain_string, buf_size); |
1262 | break; | 1261 | break; |
1263 | } | 1262 | } |
1264 | return buf; | 1263 | return buf; |