Skip to content

Commit

Permalink
Work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
MariusNi committed Nov 12, 2024
1 parent 4441f09 commit 0a77a0c
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions src/common/commonutils/UrlUtils.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,15 @@ char* UrlEncode(const char* target)
encodedTarget[j] = target[i];
j += 1;
}
else if ((j + 3) < targetSize)
else if ('\n' == target[i])
{
if ('\n' == target[i])
{
memcpy(&encodedTarget[j], "%0A", sizeof("%0A"));
j += strlen(&encodedTarget[j]);
}
else
{
sprintf(&encodedTarget[j], "%%%02X", target[i]);
j += strlen(&encodedTarget[j]);
}
memcpy(&encodedTarget[j], "%0A", 3);
j += 3;
}
else
{
sprintf(&encodedTarget[j], "%%%02X", target[i]);
j += 3;
}
}
}
Expand Down

0 comments on commit 0a77a0c

Please sign in to comment.