Skip to content

Commit

Permalink
Fix: request builder for the AI Service (#15879)
Browse files Browse the repository at this point in the history
  • Loading branch information
viachaslavic authored Nov 6, 2023
1 parent 7237b6a commit 6b0313e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tasks/task_translation.c
Original file line number Diff line number Diff line change
Expand Up @@ -1547,17 +1547,17 @@ static void build_request_url(char *buffer, size_t length, settings_t *settings)
&& video_st->poke->load_texture
&& video_st->poke->unload_texture;
#endif

_len = strlcpy(buffer, service_url, length);
buffer += _len;
length -= _len;


token[1] = '\0';
if (strrchr(buffer, '?'))
if (strrchr(service_url, '?'))
token[0] = '&';
else
token[0] = '?';


_len = strlcpy(buffer, service_url, length);
buffer += _len ;
length -= _len;

if (service_source_lang != TRANSLATION_LANG_DONT_CARE)
{
const char *lang_source
Expand All @@ -1569,7 +1569,7 @@ static void build_request_url(char *buffer, size_t length, settings_t *settings)
buffer += _len;
length -= _len;

_len = strlcpy(buffer + _len, "source_lang=", length - _len);
_len = strlcpy(buffer, "source_lang=", length);
buffer += _len;
length -= _len;

Expand Down

0 comments on commit 6b0313e

Please sign in to comment.