mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-12-28 10:03:36 +00:00
Minor tweak to avoid possible undefined behaviour.
This commit is contained in:
parent
29896e2ac6
commit
442ba99ada
1 changed files with 8 additions and 3 deletions
11
html.c
11
html.c
|
@ -1147,10 +1147,12 @@ xs_str *html_entry(snac *user, xs_str *os, const xs_dict *msg, int local,
|
||||||
/* not a list */
|
/* not a list */
|
||||||
tag = xs_list_new();
|
tag = xs_list_new();
|
||||||
tag = xs_list_append(tag, p);
|
tag = xs_list_append(tag, p);
|
||||||
} else {
|
|
||||||
/* is a list */
|
|
||||||
tag = xs_dup(p);
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
if (xs_type(p) == XSTYPE_LIST)
|
||||||
|
tag = xs_dup(p);
|
||||||
|
else
|
||||||
|
tag = xs_list_new();
|
||||||
|
|
||||||
xs_list *tags = tag;
|
xs_list *tags = tag;
|
||||||
|
|
||||||
|
@ -1291,7 +1293,10 @@ xs_str *html_entry(snac *user, xs_str *os, const xs_dict *msg, int local,
|
||||||
attach = xs_list_append(attach, v);
|
attach = xs_list_append(attach, v);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
if (xs_type(v) == XSTYPE_LIST)
|
||||||
attach = xs_dup(v);
|
attach = xs_dup(v);
|
||||||
|
else
|
||||||
|
attach = xs_list_new();
|
||||||
|
|
||||||
/* does the message have an image? */
|
/* does the message have an image? */
|
||||||
if (xs_type(v = xs_dict_get(msg, "image")) == XSTYPE_DICT) {
|
if (xs_type(v = xs_dict_get(msg, "image")) == XSTYPE_DICT) {
|
||||||
|
|
Loading…
Reference in a new issue