]>
www.infradead.org Git - users/dwmw2/openconnect.git/commit
Clean up dodgy query-string building in gpst.c
This function helps a lot:
static int filter_opts(struct oc_text_buf *buf, const char *query, const char *incexc, int include)
It takes a URL query string and a comma-separated list of fields to include
or exclude, and copies fields into the buffer, e.g.
/* include=1: copy only the named fields into the buffer */
filter_opts(buf, vpninfo->cookie, "user,authcookie", 1);
/* include=0: copy all fields except the named ones into the buffer */
filter_opts(buf, vpninfo->cookie, "authcookie,junk", 0);
Signed-off-by: Daniel Lenski <dlenski@gmail.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>