Fix invalid characters in QR codes
This commit is contained in:
@@ -157,6 +157,18 @@ Result http_get(char *url, char *path)
|
|||||||
filename = strtok(content_disposition, "\"");
|
filename = strtok(content_disposition, "\"");
|
||||||
filename = strtok(NULL, "\"");
|
filename = strtok(NULL, "\"");
|
||||||
|
|
||||||
|
char *illegal_characters = "\"?;:/\\+";
|
||||||
|
for (ssize_t i = 0; i < strlen(filename); i++)
|
||||||
|
{
|
||||||
|
for (ssize_t n = 0; n < strlen(illegal_characters); n++)
|
||||||
|
{
|
||||||
|
if (filename[i] == illegal_characters[n])
|
||||||
|
{
|
||||||
|
filename[i] = '-';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
do {
|
do {
|
||||||
ret = httpcDownloadData(&context, buf + size, 0x1000, &read_size);
|
ret = httpcDownloadData(&context, buf + size, 0x1000, &read_size);
|
||||||
size += read_size;
|
size += read_size;
|
||||||
|
|||||||
Reference in New Issue
Block a user