summaryrefslogtreecommitdiff
path: root/xs_url.h
diff options
context:
space:
mode:
authorGravatar default2024-11-07 23:23:10 +0100
committerGravatar default2024-11-07 23:23:10 +0100
commitcf980ba95b6665aff7d3cf55a88ce1e0b90c4d03 (patch)
tree87b7ae3576e765f5f0e835571a09fa7e542c2aa8 /xs_url.h
parentMerge branch 'master' of comam.es:git/snac2 (diff)
downloadpenes-snac2-cf980ba95b6665aff7d3cf55a88ce1e0b90c4d03.tar.gz
penes-snac2-cf980ba95b6665aff7d3cf55a88ce1e0b90c4d03.tar.xz
penes-snac2-cf980ba95b6665aff7d3cf55a88ce1e0b90c4d03.zip
Fixed crash in posts from the links browser.
Diffstat (limited to '')
-rw-r--r--xs_url.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/xs_url.h b/xs_url.h
index 1738634..bc4e87c 100644
--- a/xs_url.h
+++ b/xs_url.h
@@ -196,7 +196,7 @@ xs_dict *xs_multipart_form_data(const char *payload, int p_size, const char *hea
196 if (fn != NULL) { 196 if (fn != NULL) {
197 /* p_var value is a list */ 197 /* p_var value is a list */
198 /* if filename has no extension and content-type is image, attach extension to the filename */ 198 /* if filename has no extension and content-type is image, attach extension to the filename */
199 if (strchr(fn, '.') == NULL && xs_startswith(ct, "image/")) { 199 if (strchr(fn, '.') == NULL && ct && xs_startswith(ct, "image/")) {
200 char *ext = strchr(ct, '/'); 200 char *ext = strchr(ct, '/');
201 ext++; 201 ext++;
202 fn = xs_str_cat(xs_str_new(""), fn, ".", ext); 202 fn = xs_str_cat(xs_str_new(""), fn, ".", ext);