diff --git a/build.sh b/build.sh index a0bdd2a..33b8fe2 100755 --- a/build.sh +++ b/build.sh @@ -1 +1 @@ -gcc -g -o cReddit main.c reddit.c jsmn.c -lncurses `curl-config --libs` +gcc -g -o cReddit `curl-config --cflags` main.c reddit.c jsmn.c -lncurses `curl-config --libs` diff --git a/reddit.h b/reddit.h index 02a0a19..a626047 100644 --- a/reddit.h +++ b/reddit.h @@ -6,9 +6,14 @@ #include #include "jsmn.h" #include - -#define REDDIT_URL_BASE_LENGTH 21 - + +/* REDDIT_URL_BASE_LENGTH captures the base URL, the trailing '/' after a + * subreddit and the ".json" suffix. Excluding the subreddit and sorting, + * it looks like the following: http://reddit.com/.json + * This is currently defined to be 23 bytes, we add 1 more for '\0' + * termination. */ +#define REDDIT_URL_BASE_LENGTH 24 + struct MemoryStruct { char *memory; size_t size;