task_pl_thumbnail_download.c - put char string of 8192 length

on heap for all platforms
This commit is contained in:
twinaphex 2021-03-29 09:28:26 +02:00
parent ba7900a3fb
commit cc8160d044

View File

@ -89,11 +89,7 @@ static bool get_thumbnail_paths(
char *path, size_t path_size,
char *url, size_t url_size)
{
#if defined(__PSL1GHT__) || defined(__PS3__)
char *raw_url;
#else
char raw_url[8192];
#endif
char content_dir[PATH_MAX_LENGTH];
char tmp_buf[PATH_MAX_LENGTH];
const char *system = NULL;
@ -153,12 +149,10 @@ static bool get_thumbnail_paths(
if (string_is_empty(path))
return false;
#if defined(__PSL1GHT__) || defined(__PS3__)
raw_url = (char*)malloc(8192 * sizeof(char));
if (!raw_url)
return false;
#endif
raw_url[0] = '\0';
/* Generate remote path */
@ -170,19 +164,13 @@ static bool get_thumbnail_paths(
);
if (string_is_empty(raw_url))
#if defined(__PSL1GHT__) || defined(__PS3__)
{
free(raw_url);
return false;
}
#else
return false;
#endif
net_http_urlencode_full(url, raw_url, url_size);
#if defined(__PSL1GHT__) || defined(__PS3__)
free(raw_url);
#endif
if (string_is_empty(url))
return false;