aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgrunfink <grunfink@comam.es>2026-08-26 07:24:25 +0200
committergrunfink <grunfink@comam.es>2026-08-26 07:24:25 +0200
commit6ae12b03d5566b9119c78d79a96df7ac12b2c636 (patch)
treef2319e1ec9edbb8f7d01ec3cef680012610b3720
parent99544bf77226f2889bb1969eea440b2c8716b814 (diff)
In the people page, strip absurdly long location coordinates due to floating point inaccuracies.
-rw-r--r--html.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/html.c b/html.c
index 8cb2370..3f35040 100644
--- a/html.c
+++ b/html.c
@@ -3899,7 +3899,10 @@ xs_html *html_people_list(snac *user, xs_list *list, const char *header, const c
const char *lo = xs_is_string(longitude) ? longitude : xs_number_str(longitude);
if (xs_is_string(la) && xs_is_string(lo)) {
- xs *label = xs_fmt("%s,%s", la, lo);
+ xs *sla = xs_utf8_crop_i(xs_dup(la), 0, 7);
+ xs *slo = xs_utf8_crop_i(xs_dup(lo), 0, 7);
+
+ xs *label = xs_fmt("%s,%s", sla, slo);
xs *url = xs_fmt("https://openstreetmap.org/search?query=%s,%s", la, lo);
xs_html_add(snac_post,