You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.
Using a custom server URL without recompiling should be possible. It should be read from the feeds.xml from the <url> attribute of the <rss> tag (like this: <rss url="http://u.wiidb.de/rssmii/rss_test_displayer.php">
The code already has the basics, but I suck at C and mxmlElementGetAttr wants a const char * 🤔
The text was updated successfully, but these errors were encountered:
I guess you mean this compiler warning: warning: assignment discards ‘const’ qualifier from pointer target type
A const pointer means that the memory this pointer is pointing to should not be modified once assigned.
You have two options to get rid of this warning:
Ignore the warning by just casting it to a char*implicitly server_url = (char*) mxmlElementGetAttr(rss, "url");
Copy the contents of the result into you server_url pointer
char* server_url;
const char* tmp_server_url = mxmlElementGetAttr(rss, "url");
if (tmp_server_url != NULL)
{
size_t url_lenght = strlen(tmp_server_url);
server_url = malloc(url_lenght + 1); // allocate memory for the string and the null terminator
strcpy(server_url, tmp_server_url);
}
else
{
server_url = "http://u.wiidb.de/rssmii/rss_displayer.php";
}
Edit: this is better or else you cannot free your server url:
const char* default_server_url = "http://u.wiidb.de/rssmii/rss_displayer.php";
char* server_url;
const char* tmp_server_url = mxmlElementGetAttr(rss, "url");
if (tmp_server_url != NULL)
{
size_t url_lenght = strlen(tmp_server_url);
server_url = malloc(url_lenght + 1); // allocate memory for the string and the null terminator
strcpy(server_url, tmp_server_url);
}
else
{
size_t url_lenght = strlen(default_server_url);
server_url = malloc(url_lenght + 1); // allocate memory for the string and the null terminator
strcpy(server_url, default_server_url);
}
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Using a custom server URL without recompiling should be possible. It should be read from the feeds.xml from the
<url>
attribute of the<rss>
tag (like this:<rss url="http://u.wiidb.de/rssmii/rss_test_displayer.php">
The code already has the basics, but I suck at C and
mxmlElementGetAttr
wants aconst char *
🤔The text was updated successfully, but these errors were encountered: