mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-22 05:15:04 +00:00
Fixed crash in posts from the links browser.
This commit is contained in:
parent
b2555fb6b9
commit
cf980ba95b
1 changed files with 1 additions and 1 deletions
2
xs_url.h
2
xs_url.h
|
@ -196,7 +196,7 @@ xs_dict *xs_multipart_form_data(const char *payload, int p_size, const char *hea
|
|||
if (fn != NULL) {
|
||||
/* p_var value is a list */
|
||||
/* if filename has no extension and content-type is image, attach extension to the filename */
|
||||
if (strchr(fn, '.') == NULL && xs_startswith(ct, "image/")) {
|
||||
if (strchr(fn, '.') == NULL && ct && xs_startswith(ct, "image/")) {
|
||||
char *ext = strchr(ct, '/');
|
||||
ext++;
|
||||
fn = xs_str_cat(xs_str_new(""), fn, ".", ext);
|
||||
|
|
Loading…
Reference in a new issue