#include <Xm/Text.h>
#include <curl/curl.h>
-struct MemoryStruct {
+struct memstruct {
char *memory;
size_t size;
};
memback(void *contents, size_t size, size_t nmemb, void *userp)
{
size_t realsize = size * nmemb;
- struct MemoryStruct *mem = (struct MemoryStruct *)userp;
+ struct memstruct *mem = (struct memstruct *)userp;
char *ptr = realloc(mem->memory, mem->size + realsize + 1);
if (!ptr) memfail();
exit(1);
}
- struct MemoryStruct chunk;
+ struct memstruct chunk;
chunk.memory = malloc(1); // Grown as needed by the realloc in memback()
chunk.size = 0; // No data yet
// Extract text from between HTML tags
int j = 1;
- for (int i = 345; i < strlen(chunk.memory); i++) {
+ for (int i = 345; (size_t)i < strlen(chunk.memory); i++) {
char c = chunk.memory[i];
if (c == '<') intag = true;
if (!intag) {
char *nl = (char *) calloc(1, sizeof(char));
if (!nl) memfail();
- for (int i = 0; i < strlen(outp) - 1; i++) {
+ for (int i = 0; (size_t)i < strlen(outp) - 1; i++) {
if (outp[i] == '\n' && outp[i+1] == '\n') i+=4;
nl = (char *) realloc(nl, i);
if (!nl) memfail();