diff options
author | Tim Prouty <tim.prouty@isilon.com> | 2008-04-29 14:36:24 -0700 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2008-05-20 22:40:13 +0200 |
commit | 6b189dabc562d86dcaa685419d0cb6ea276f100d (patch) | |
tree | 4db914671846d04e2249b50e770932da31408e22 /source/web | |
parent | 80e700e3bd73f2ffa38046bdcba7f532e25198ef (diff) | |
download | samba-6b189dabc562d86dcaa685419d0cb6ea276f100d.tar.gz samba-6b189dabc562d86dcaa685419d0cb6ea276f100d.tar.xz samba-6b189dabc562d86dcaa685419d0cb6ea276f100d.zip |
Cleanup size_t return values in callers of convert_string_allocate
This patch is the second iteration of an inside-out conversion to cleanup
functions in charcnv.c returning size_t == -1 to indicate failure.
Diffstat (limited to 'source/web')
-rw-r--r-- | source/web/statuspage.c | 3 | ||||
-rw-r--r-- | source/web/swat.c | 14 |
2 files changed, 10 insertions, 7 deletions
diff --git a/source/web/statuspage.c b/source/web/statuspage.c index eda53b66ab3..ce24c7cddd4 100644 --- a/source/web/statuspage.c +++ b/source/web/statuspage.c @@ -123,6 +123,7 @@ static void print_share_mode(const struct share_mode_entry *e, { char *utf8_fname; int deny_mode; + size_t converted_size; if (!is_valid_share_mode_entry(e)) { return; @@ -169,7 +170,7 @@ static void print_share_mode(const struct share_mode_entry *e, printf("NONE "); printf("</td>"); - push_utf8_allocate(&utf8_fname, fname); + push_utf8_allocate(&utf8_fname, fname, &converted_size); printf("<td>%s</td><td>%s</td></tr>\n", utf8_fname,tstring(talloc_tos(),e->time.tv_sec)); SAFE_FREE(utf8_fname); diff --git a/source/web/swat.c b/source/web/swat.c index 6d8f4cae06f..3e14d2d0980 100644 --- a/source/web/swat.c +++ b/source/web/swat.c @@ -228,6 +228,7 @@ static void show_parameter(int snum, struct parm_struct *parm) int i; void *ptr = parm->ptr; char *utf8_s1, *utf8_s2; + size_t converted_size; TALLOC_CTX *ctx = talloc_stackframe(); if (parm->p_class == P_LOCAL && snum >= 0) { @@ -252,12 +253,12 @@ static void show_parameter(int snum, struct parm_struct *parm) for (;*list;list++) { /* enclose in HTML encoded quotes if the string contains a space */ if ( strchr_m(*list, ' ') ) { - push_utf8_allocate(&utf8_s1, *list); - push_utf8_allocate(&utf8_s2, ((*(list+1))?", ":"")); + push_utf8_allocate(&utf8_s1, *list, &converted_size); + push_utf8_allocate(&utf8_s2, ((*(list+1))?", ":""), &converted_size); printf(""%s"%s", utf8_s1, utf8_s2); } else { - push_utf8_allocate(&utf8_s1, *list); - push_utf8_allocate(&utf8_s2, ((*(list+1))?", ":"")); + push_utf8_allocate(&utf8_s1, *list, &converted_size); + push_utf8_allocate(&utf8_s2, ((*(list+1))?", ":""), &converted_size); printf("%s%s", utf8_s1, utf8_s2); } SAFE_FREE(utf8_s1); @@ -282,7 +283,7 @@ static void show_parameter(int snum, struct parm_struct *parm) case P_STRING: case P_USTRING: - push_utf8_allocate(&utf8_s1, *(char **)ptr); + push_utf8_allocate(&utf8_s1, *(char **)ptr, &converted_size); printf("<input type=text size=40 name=\"parm_%s\" value=\"%s\">", make_parm_name(parm->label), fix_quotes(ctx, utf8_s1)); SAFE_FREE(utf8_s1); @@ -897,6 +898,7 @@ static void shares_page(void) int i; int mode = 0; unsigned int parm_filter = FLAG_BASIC; + size_t converted_size; if (share) snum = lp_servicenumber(share); @@ -951,7 +953,7 @@ static void shares_page(void) for (i=0;i<lp_numservices();i++) { s = lp_servicename(i); if (s && (*s) && strcmp(s,"IPC$") && !lp_print_ok(i)) { - push_utf8_allocate(&utf8_s, s); + push_utf8_allocate(&utf8_s, s, &converted_size); printf("<option %s value=\"%s\">%s\n", (share && strcmp(share,s)==0)?"SELECTED":"", utf8_s, utf8_s); |