Skip to content

Commit

Permalink
append_opt() and buf_append_urlencoded() should take const char *
Browse files Browse the repository at this point in the history
Fixes -Wcast-qual warnings.

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
  • Loading branch information
dlenski authored and dwmw2 committed Dec 13, 2016
1 parent 01d40d8 commit 685704f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion auth-common.c
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion http.c
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions openconnect-internal.h
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 685704f

Please sign in to comment.