]> git.armaanb.net Git - mmenu.git/blobdiff - mmenu.c
Rename MemoryStruct
[mmenu.git] / mmenu.c
diff --git a/mmenu.c b/mmenu.c
index b00af5af1b2d7ee11962f2c003fb7559b50c53f4..fca9599b3bdcd64c58f807515e3f52cb1e1eca7e 100644 (file)
--- a/mmenu.c
+++ b/mmenu.c
@@ -5,7 +5,7 @@
 #include <Xm/Text.h>
 #include <curl/curl.h>
 
-struct MemoryStruct {
+struct memstruct {
        char *memory;
        size_t size;
 };
@@ -22,7 +22,7 @@ static size_t
 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();
@@ -47,7 +47,7 @@ main(int argc, char *argv[])
                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
 
@@ -76,7 +76,7 @@ main(int argc, char *argv[])
 
        // 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) {
@@ -92,7 +92,7 @@ main(int argc, char *argv[])
        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();