]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
append_opt() and buf_append_urlencoded() should take const char *
authorDaniel Lenski <dlenski@gmail.com>
Sat, 15 Oct 2016 01:46:32 +0000 (18:46 -0700)
committerDavid Woodhouse <dwmw2@infradead.org>
Tue, 13 Dec 2016 11:45:29 +0000 (11:45 +0000)
Fixes -Wcast-qual warnings.

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
auth-common.c
http.c
openconnect-internal.h

index 848f882f1cbd119ea55b00e46f2f46fb283cebb2..c0943042a096e72032d55efcbb13e31a1c4b1193 100644 (file)
@@ -62,7 +62,7 @@ int xmlnode_match_prop(xmlNode *xml_node, const char *name, const char *match)
        return ret;
 }
 
-int append_opt(struct oc_text_buf *body, char *opt, char *name)
+int append_opt(struct oc_text_buf *body, const char *opt, const char *name)
 {
        if (buf_error(body))
                return buf_error(body);
diff --git a/http.c b/http.c
index cde4b4045fcc2a6c63b31754f75d3d7049e325f1..28bac5aac7113254132ef3712160886eb126dc4e 100644 (file)
--- a/http.c
+++ b/http.c
@@ -41,7 +41,7 @@ struct oc_text_buf *buf_alloc(void)
        return calloc(1, sizeof(struct oc_text_buf));
 }
 
-void buf_append_urlencoded(struct oc_text_buf *buf, char *str)
+void buf_append_urlencoded(struct oc_text_buf *buf, const char *str)
 {
        while (str && *str) {
                unsigned char c = *str;
index f68c2d9175575678fefb778c6a0bb9923adf4fd3..a24a9e48a7be6a2524a468ceafa590045a220557 100644 (file)
@@ -973,7 +973,7 @@ int cstp_obtain_cookie(struct openconnect_info *vpninfo);
 int xmlnode_is_named(xmlNode *xml_node, const char *name);
 int xmlnode_get_prop(xmlNode *xml_node, const char *name, char **var);
 int xmlnode_match_prop(xmlNode *xml_node, const char *name, const char *match);
-int append_opt(struct oc_text_buf *body, char *opt, char *name);
+int append_opt(struct oc_text_buf *body, const char *opt, const char *name);
 int append_form_opts(struct openconnect_info *vpninfo,
                     struct oc_auth_form *form, struct oc_text_buf *body);
 void free_opt(struct oc_form_opt *opt);
@@ -996,7 +996,7 @@ int buf_append_utf16le(struct oc_text_buf *buf, const char *utf8);
 int get_utf8char(const char **utf8);
 void buf_append_from_utf16le(struct oc_text_buf *buf, const void *utf16);
 void buf_truncate(struct oc_text_buf *buf);
-void buf_append_urlencoded(struct oc_text_buf *buf, char *str);
+void buf_append_urlencoded(struct oc_text_buf *buf, const char *str);
 int buf_error(struct oc_text_buf *buf);
 int buf_free(struct oc_text_buf *buf);
 char *openconnect_create_useragent(const char *base);