diff options
author | default <nobody@localhost> | 2023-05-02 06:49:00 +0200 |
---|---|---|
committer | default <nobody@localhost> | 2023-05-02 06:49:00 +0200 |
commit | be5f08e6c3d605fb2beb1fdd1c2f10818b1e1812 (patch) | |
tree | b2d269df739a5283d3489f1996065a57a16a4edc /webfinger.c | |
parent | 29815a38736666e2226454d96ba444843853dca5 (diff) |
Use xs_replace_n() where it suits.
Diffstat (limited to 'webfinger.c')
-rw-r--r-- | webfinger.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/webfinger.c b/webfinger.c index eb6b2ad..f56b6f2 100644 --- a/webfinger.c +++ b/webfinger.c @@ -21,7 +21,7 @@ int webfinger_request(const char *qs, char **actor, char **user) if (xs_startswith(qs, "https:/" "/")) { /* actor query: pick the host */ - xs *s = xs_replace(qs, "https:/" "/", ""); + xs *s = xs_replace_n(qs, "https:/" "/", "", 1); l = xs_split_n(s, "/", 1); @@ -74,7 +74,7 @@ int webfinger_request(const char *qs, char **actor, char **user) char *subject = xs_dict_get(obj, "subject"); if (subject) - *user = xs_replace(subject, "acct:", ""); + *user = xs_replace_n(subject, "acct:", "", 1); } if (actor != NULL) { @@ -136,7 +136,7 @@ int webfinger_get_handler(d_char *req, char *q_path, else if (xs_startswith(resource, "acct:")) { /* it's an account name */ - xs *an = xs_replace(resource, "acct:", ""); + xs *an = xs_replace_n(resource, "acct:", "", 1); xs *l = NULL; /* strip a possible leading @ */ |