diff options
Diffstat (limited to 'apps/gui/wps_parser.c')
-rw-r--r-- | apps/gui/wps_parser.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/apps/gui/wps_parser.c b/apps/gui/wps_parser.c index 09bcab8443..8ae83924c2 100644 --- a/apps/gui/wps_parser.c +++ b/apps/gui/wps_parser.c | |||
@@ -1489,8 +1489,7 @@ static bool wps_parse(struct wps_data *data, const char *wps_bufptr) | |||
1489 | break; | 1489 | break; |
1490 | } | 1490 | } |
1491 | 1491 | ||
1492 | strncpy(stringbuf, string_start, len); | 1492 | strlcpy(stringbuf, string_start, len+1); |
1493 | *(stringbuf + len) = '\0'; | ||
1494 | 1493 | ||
1495 | data->strings[data->num_strings] = stringbuf; | 1494 | data->strings[data->num_strings] = stringbuf; |
1496 | stringbuf += len + 1; | 1495 | stringbuf += len + 1; |
@@ -1781,11 +1780,9 @@ bool wps_data_load(struct wps_data *wps_data, | |||
1781 | #ifdef HAVE_LCD_BITMAP | 1780 | #ifdef HAVE_LCD_BITMAP |
1782 | /* get the bitmap dir */ | 1781 | /* get the bitmap dir */ |
1783 | char bmpdir[MAX_PATH]; | 1782 | char bmpdir[MAX_PATH]; |
1784 | size_t bmpdirlen; | ||
1785 | char *dot = strrchr(buf, '.'); | 1783 | char *dot = strrchr(buf, '.'); |
1786 | bmpdirlen = dot - buf; | 1784 | |
1787 | strncpy(bmpdir, buf, dot - buf); | 1785 | strlcpy(bmpdir, buf, dot - buf + 1); |
1788 | bmpdir[bmpdirlen] = 0; | ||
1789 | 1786 | ||
1790 | /* load the bitmaps that were found by the parsing */ | 1787 | /* load the bitmaps that were found by the parsing */ |
1791 | if (!load_wps_bitmaps(wps_data, bmpdir)) { | 1788 | if (!load_wps_bitmaps(wps_data, bmpdir)) { |