summaryrefslogtreecommitdiff
path: root/handler.c
diff options
context:
space:
mode:
Diffstat (limited to 'handler.c')
-rw-r--r--handler.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/handler.c b/handler.c
index 118519d..37469ba 100644
--- a/handler.c
+++ b/handler.c
@@ -1,8 +1,11 @@
+#include <stdio.h>
#include <stdbool.h>
#include <tidy.h>
#include <tidybuffio.h>
#include <icclient.h>
+#define SUBDIR "/items"
+
static void recurse_catalog(TidyDoc doc, TidyNode tnod, const char *image_dir,
struct icclient_catalog **catalog)
{
@@ -14,8 +17,8 @@ static void recurse_catalog(TidyDoc doc, TidyNode tnod, const char *image_dir,
recurse_catalog(doc, child, image_dir, catalog);
continue;
}
- static const char *subdir = "/thumb/";
- char prefix[strlen(image_dir) + strlen(subdir) + 1];
+ char prefix[strlen(image_dir) + strlen(SUBDIR) + 1];
+ sprintf(prefix, "%s%s", image_dir, SUBDIR);
size_t prefix_len = strlen(prefix);
bool bail = false;
for (TidyAttr attr = tidyAttrFirst(child); attr; attr = tidyAttrNext(attr))