links

lynx-like text mode web browser
git clone anongit@rnpnr.xyz:links.git
Log | Files | Refs | Feed | README | LICENSE

Commit: d0f97c6b03f4feec0a708a08d1e47d8713c70b9e
Parent: 96b1173d13e56d729b8fb8f19a159e7b40c04ae1
Author: Randy Palamar
Date:   Wed, 30 Nov 2022 07:54:45 -0700

add_chr_to_str(): return new text length

Diffstat:
Mauth.c | 2+-
Mbookmark.c | 2+-
Mcache.c | 6+++---
Mcompress.c | 2+-
Mconnect.c | 12++++++------
Mcookies.c | 2+-
Mdata.c | 2+-
Mdefault.c | 80+++++++++++++++++++++++++++++++++++++++----------------------------------------
Mfile.c | 18+++++++++---------
Mhtml.c | 4++--
Mhttp.c | 12++++++------
Mhttps.c | 4++--
Mlinks.h | 2+-
Mmenu.c | 44++++++++++++++++++++++----------------------
Mselect.c | 10+++++-----
Msession.c | 54+++++++++++++++++++++++++++---------------------------
Mstring.c | 6+++---
Mterminal.c | 35++++++++++++++++-------------------
Murl.c | 29+++++++++++++++--------------
Mview.c | 62+++++++++++++++++++++++++++++++-------------------------------
20 files changed, 192 insertions(+), 196 deletions(-)

diff --git a/auth.c b/auth.c @@ -116,7 +116,7 @@ try_next: while (*q && *q != '"') { if (*q == '\\' && !*++q) break; - add_chr_to_str(&r, &l, *q++); + l = add_chr_to_str(&r, l, *q++); } free(h); return r; diff --git a/bookmark.c b/bookmark.c @@ -720,7 +720,7 @@ convert_to_entity_string(unsigned char *str) break; default: - add_chr_to_str(&dst, &dstl, *p); + dstl = add_chr_to_str(&dst, dstl, *p); } return dst; } diff --git a/cache.c b/cache.c @@ -153,8 +153,8 @@ get_connection_cache_entry(struct connection *c) if (c->last_lookup_state.addr.n > 1) { int i, d = 0; if (l) - add_chr_to_str(&s, &l, ' '); - add_chr_to_str(&s, &l, '('); + l = add_chr_to_str(&s, l, ' '); + l = add_chr_to_str(&s, l, '('); for (i = 0; i < c->last_lookup_state.addr.n; i++) { if (i == c->last_lookup_state.addr_index) continue; @@ -168,7 +168,7 @@ get_connection_cache_entry(struct connection *c) d = 1; } } - add_chr_to_str(&s, &l, ')'); + l = add_chr_to_str(&s, l, ')'); } e->ip_address = s; } diff --git a/compress.c b/compress.c @@ -416,6 +416,6 @@ add_compress_methods(unsigned char **s, int *l) #ifdef zlib_version add_to_str(s, l, cast_uchar " ("); add_to_str(s, l, (unsigned char *)zlib_version); - add_chr_to_str(s, l, ')'); + *l = add_chr_to_str(s, *l, ')'); #endif } diff --git a/connect.c b/connect.c @@ -273,20 +273,20 @@ handle_socks(void *c_) struct connection *c = (struct connection *)c_; struct conn_info *b = c->newconn; unsigned char *command = NULL; - int len = 0; + int len; unsigned char *host; int wr; setcstate(c, S_SOCKS_NEG); set_connection_timeout(c); - len = add_bytes_to_str(&command, len, cast_uchar "\004\001", 2); - add_chr_to_str(&command, &len, b->l.target_port >> 8); - add_chr_to_str(&command, &len, b->l.target_port); + len = add_bytes_to_str(&command, 0, cast_uchar "\004\001", 2); + len = add_chr_to_str(&command, len, b->l.target_port >> 8); + len = add_chr_to_str(&command, len, b->l.target_port); len = add_bytes_to_str(&command, len, cast_uchar "\000\000\000\001", 4); if (strchr(c->socks_proxy, '@')) len = add_bytes_to_str(&command, len, (unsigned char *)c->socks_proxy, strcspn(c->socks_proxy, "@")); - add_chr_to_str(&command, &len, 0); + len = add_chr_to_str(&command, len, 0); if (!(host = get_host_name(c->url))) { free(command); setcstate(c, S_INTERNAL); @@ -295,7 +295,7 @@ handle_socks(void *c_) } add_to_str(&command, &len, host); add_to_str(&command, &len, c->dns_append); - add_chr_to_str(&command, &len, 0); + len = add_chr_to_str(&command, len, 0); free(host); if (b->socks_byte_count >= len) { free(command); diff --git a/cookies.c b/cookies.c @@ -230,7 +230,7 @@ ok: add_to_str(s, l, cast_uchar "; "); add_to_str(s, l, c->name); if (c->value) { - add_chr_to_str(s, l, '='); + *l = add_chr_to_str(s, *l, '='); add_to_str(s, l, c->value); } } diff --git a/data.c b/data.c @@ -25,7 +25,7 @@ base64_decode(unsigned char **d, int *dl, unsigned char *s, int sl) bits += 6; if (bits >= 8) { bits -= 8; - add_chr_to_str(d, dl, tmp >> bits); + *dl = add_chr_to_str(d, *dl, tmp >> bits); tmp &= (1 << bits) - 1; } } diff --git a/default.c b/default.c @@ -27,9 +27,9 @@ get_system_name(void) unsigned char *str = NULL; int l = 0; add_to_str(&str, &l, cast_uchar name.sysname); - add_chr_to_str(&str, &l, ' '); + l = add_chr_to_str(&str, l, ' '); add_to_str(&str, &l, cast_uchar name.release); - add_chr_to_str(&str, &l, ' '); + l = add_chr_to_str(&str, l, ' '); add_to_str(&str, &l, cast_uchar name.machine); safe_strncpy(system_name, str, MAX_STR_LEN); free(str); @@ -120,7 +120,7 @@ get_token(unsigned char **line) continue; } else if ((**line == ' ' || **line == 9) && !quote) break; - add_chr_to_str(&s, &l, **line); + l = add_chr_to_str(&s, l, **line); } } return s; @@ -512,20 +512,20 @@ add_nm(struct option *o, unsigned char **s, int *l) if (*l) add_to_str(s, l, cast_uchar "\n"); add_to_str(s, l, cast_uchar o->cfg_name); - add_chr_to_str(s, l, ' '); + *l = add_chr_to_str(s, *l, ' '); } -static void -add_quoted_to_str(unsigned char **s, int *l, unsigned char *q) +static size_t +add_quoted_to_str(unsigned char **s, size_t l, unsigned char *q) { - add_chr_to_str(s, l, '"'); + l = add_chr_to_str(s, l, '"'); while (*q) { if (*q == '"' || *q == '\\') - add_chr_to_str(s, l, '\\'); - add_chr_to_str(s, l, *q); + l = add_chr_to_str(s, l, '\\'); + l = add_chr_to_str(s, l, *q); q++; } - add_chr_to_str(s, l, '"'); + return add_chr_to_str(s, l, '"'); } static unsigned char * @@ -619,10 +619,10 @@ str_wr(struct option *o, unsigned char **s, int *l) if (strlen(cast_const_char o->ptr) + 1 > (size_t)o->max) { unsigned char *s1 = NULL; add_bytes_to_str(&s1, 0, o->ptr, o->max - 1); - add_quoted_to_str(s, l, s1); + *l = add_quoted_to_str(s, *l, s1); free(s1); } else - add_quoted_to_str(s, l, o->ptr); + *l = add_quoted_to_str(s, *l, o->ptr); } static unsigned char * @@ -711,18 +711,18 @@ type_wr(struct option *o, unsigned char **s, int *l) foreachback (struct list, a, la, assoc.list_entry) { struct assoc *as = get_struct(a, struct assoc, head); add_nm(o, s, l); - add_quoted_to_str(s, l, as->label); - add_chr_to_str(s, l, ' '); - add_quoted_to_str(s, l, as->ct); + *l = add_quoted_to_str(s, *l, as->label); + *l = add_chr_to_str(s, *l, ' '); + *l = add_quoted_to_str(s, *l, as->ct); add_to_str(s, l, cast_uchar " "); - add_quoted_to_str(s, l, as->prog); - add_chr_to_str(s, l, ' '); + *l = add_quoted_to_str(s, *l, as->prog); + *l = add_chr_to_str(s, *l, ' '); add_num_to_str(s, l, (!!as->cons) + (!!as->xwin) * 2 + (!!as->ask) * 4 + (!as->block) * 8 + (!!as->block) * 16 + (!!as->accept_http) * 32 + (!!as->accept_ftp) * 64); - add_chr_to_str(s, l, ' '); + *l = add_chr_to_str(s, *l, ' '); add_num_to_str(s, l, as->system); } } @@ -753,9 +753,9 @@ ext_wr(struct option *o, unsigned char **s, int *l) foreachback (struct list, a, la, extensions.list_entry) { struct extension *e = get_struct(a, struct extension, head); add_nm(o, s, l); - add_quoted_to_str(s, l, e->ext); - add_chr_to_str(s, l, ' '); - add_quoted_to_str(s, l, e->ct); + *l = add_quoted_to_str(s, *l, e->ext); + *l = add_chr_to_str(s, *l, ' '); + *l = add_quoted_to_str(s, *l, e->ct); } } @@ -854,26 +854,26 @@ term_wr(struct option *o, unsigned char **s, int *l) struct list_head *lts; foreachback (struct term_spec, ts, lts, term_specs) { add_nm(o, s, l); - add_quoted_to_str(s, l, ts->term); - add_chr_to_str(s, l, ' '); + *l = add_quoted_to_str(s, *l, ts->term); + *l = add_chr_to_str(s, *l, ' '); add_num_to_str(s, l, ts->mode); - add_chr_to_str(s, l, ' '); + *l = add_chr_to_str(s, *l, ' '); add_num_to_str(s, l, !!ts->m11_hack); - add_chr_to_str(s, l, ' '); + *l = add_chr_to_str(s, *l, ' '); add_num_to_str(s, l, !!ts->col + !!ts->restrict_852 * 2 + !!ts->block_cursor * 4); - add_chr_to_str(s, l, ' '); + *l = add_chr_to_str(s, *l, ' '); add_to_str(s, l, get_cp_mime_name(ts->character_set)); if (ts->left_margin || ts->right_margin || ts->top_margin || ts->bottom_margin) { - add_chr_to_str(s, l, ' '); + *l = add_chr_to_str(s, *l, ' '); add_num_to_str(s, l, ts->left_margin); - add_chr_to_str(s, l, ' '); + *l = add_chr_to_str(s, *l, ' '); add_num_to_str(s, l, ts->right_margin); - add_chr_to_str(s, l, ' '); + *l = add_chr_to_str(s, *l, ' '); add_num_to_str(s, l, ts->top_margin); - add_chr_to_str(s, l, ' '); + *l = add_chr_to_str(s, *l, ' '); add_num_to_str(s, l, ts->bottom_margin); } } @@ -946,18 +946,18 @@ dp_wr(struct option *o, unsigned char **s, int *l) if (dp->nosave) continue; add_nm(o, s, l); - add_quoted_to_str(s, l, dp->name); - add_chr_to_str(s, l, ' '); - add_quoted_to_str(s, l, - dp->param ? dp->param : (unsigned char *)""); - add_chr_to_str(s, l, ' '); - add_quoted_to_str(s, l, dp->shell_term); - add_chr_to_str(s, l, ' '); + *l = add_quoted_to_str(s, *l, dp->name); + *l = add_chr_to_str(s, *l, ' '); + *l = add_quoted_to_str( + s, *l, dp->param ? dp->param : (unsigned char *)""); + *l = add_chr_to_str(s, *l, ' '); + *l = add_quoted_to_str(s, *l, dp->shell_term); + *l = add_chr_to_str(s, *l, ' '); if (dp->kbd_codepage == -1) add_to_str(s, l, cast_uchar "default"); else add_to_str(s, l, get_cp_mime_name(dp->kbd_codepage)); - add_chr_to_str(s, l, ' '); + *l = add_chr_to_str(s, *l, ' '); add_num_to_str(s, l, dp->palette_mode); /* pokud se sem neco prida, opravit podminku na zacatku cyklu */ } @@ -992,13 +992,11 @@ static unsigned char * gen_cmd(struct option *o, unsigned char ***argv, int *argc) { unsigned char *e; - int l; unsigned char *r; if (!*argc) return cast_uchar "Parameter expected"; e = NULL; - l = 0; - add_quoted_to_str(&e, &l, **argv); + add_quoted_to_str(&e, 0, **argv); r = o->rd_cfg ? o->rd_cfg(o, e) : 0; free(e); if (r) diff --git a/file.c b/file.c @@ -82,7 +82,7 @@ stat_mode(unsigned char **p, int *l, struct stat *stp) c = 'n'; #endif } - add_chr_to_str(p, l, c); + *l = add_chr_to_str(p, *l, c); if (stp) { unsigned mode = stp->st_mode; setrwx(mode << 0, &rwx[0]); @@ -91,7 +91,7 @@ stat_mode(unsigned char **p, int *l, struct stat *stp) setst(mode, rwx); } add_to_str(p, l, rwx); - add_chr_to_str(p, l, ' '); + *l = add_chr_to_str(p, *l, ' '); } static void @@ -148,8 +148,8 @@ stat_user(unsigned char **p, int *l, struct stat *stp, int g) a: add_to_str(p, l, pp); for (i = strlen(cast_const_char pp); i < 8; i++) - add_chr_to_str(p, l, ' '); - add_chr_to_str(p, l, ' '); + *l = add_chr_to_str(p, *l, ' '); + *l = add_chr_to_str(p, *l, ' '); } static void @@ -163,9 +163,9 @@ stat_size(unsigned char **p, int *l, struct stat *stp) else snzprint(num, sizeof num, stp->st_size); for (i = strlen(cast_const_char num); i < digits; i++) - add_chr_to_str(p, l, ' '); + *l = add_chr_to_str(p, *l, ' '); add_to_str(p, l, num); - add_chr_to_str(p, l, ' '); + *l = add_chr_to_str(p, *l, ' '); } static void @@ -204,7 +204,7 @@ set_empty: str[wr++] = ' '; str[12] = 0; add_to_str(p, l, str); - add_chr_to_str(p, l, ' '); + *l = add_chr_to_str(p, *l, ' '); } static unsigned char * @@ -412,14 +412,14 @@ xxx: add_conv_str(&file, &fl, dir[i].f, (int)strlen(cast_const_char dir[i].f), 1); if (dir[i].s[0] == 'd') - add_chr_to_str(&file, &fl, '/'); + fl = add_chr_to_str(&file, fl, '/'); else if (lnk) { struct stat st; unsigned char *n = stracpy(name); add_to_strn(&n, dir[i].f); EINTRLOOP(rs, stat(cast_const_char n, &st)); if (!rs && S_ISDIR(st.st_mode)) - add_chr_to_str(&file, &fl, '/'); + fl = add_chr_to_str(&file, fl, '/'); free(n); } add_to_str(&file, &fl, cast_uchar "\">"); diff --git a/html.c b/html.c @@ -2139,7 +2139,7 @@ rrrr: p++; while (p < eoff && !WHITECHAR(*p) && *p != '<') { pppp: - add_chr_to_str(&val, &l, *p); + l = add_chr_to_str(&val, l, *p); p++; } r = p; @@ -3890,7 +3890,7 @@ scan_http_equiv(unsigned char *s, unsigned char *eof, unsigned char **head, *pre_wrap = 0; if (title) *title = NULL; - add_chr_to_str(head, hdl, '\n'); + *hdl = add_chr_to_str(head, *hdl, '\n'); se: while (s < eof && *s != '<') sp: diff --git a/http.c b/http.c @@ -233,7 +233,7 @@ add_url_to_str(unsigned char **str, int *l, unsigned char *url) sprintf((char *)esc, "%%%02X", (int)*sp); add_to_str(str, l, esc); } else - add_chr_to_str(str, l, *sp); + *l = add_chr_to_str(str, *l, *sp); } } @@ -293,7 +293,7 @@ http_bad_url: h = get_port_str(host); if (!h) h = stracpy(cast_uchar "443"); - add_chr_to_str(&hdr, &l, ':'); + l = add_chr_to_str(&hdr, l, ':'); add_to_str(&hdr, &l, h); free(h); goto added_connect; @@ -304,7 +304,7 @@ http_bad_url: c->unrestartable = 2; } if (!proxy) { - add_chr_to_str(&hdr, &l, '/'); + l = add_chr_to_str(&hdr, l, '/'); u = get_url_data(host); } else u = host; @@ -350,7 +350,7 @@ added_connect: free(h); if ((h = get_port_str(host))) { if (strcmp(cast_char h, c->ssl ? "443" : "80")) { - add_chr_to_str(&hdr, &l, ':'); + l = add_chr_to_str(&hdr, l, ':'); add_to_str(&hdr, &l, h); } free(h); @@ -390,7 +390,7 @@ added_connect: : 0; if (h2 < 0 || h2 >= 16) h2 = 0; - add_chr_to_str(&hdr, &l, h1 * 16 + h2); + l = add_chr_to_str(&hdr, l, h1 * 16 + h2); post += 2; } } @@ -538,7 +538,7 @@ add_accept_charset(unsigned char **hdr, int *l, ac = NULL; cs = get_cp_mime_name(0); if (aclen) - add_chr_to_str(&ac, &aclen, ','); + aclen = add_chr_to_str(&ac, aclen, ','); else add_to_str(&ac, &aclen, cast_uchar "Accept-Charset: "); add_to_str(&ac, &aclen, cs); diff --git a/https.c b/https.c @@ -256,11 +256,11 @@ get_cipher_string(links_ssl *ssl) add_to_str(&s, &l, (unsigned char *)"-bit"); if ((version = SSL_get_version(ssl->ssl))) { - add_chr_to_str(&s, &l, ' '); + l = add_chr_to_str(&s, l, ' '); add_to_str(&s, &l, (unsigned char *)version); } if ((cipher = SSL_get_cipher_name(ssl->ssl))) { - add_chr_to_str(&s, &l, ' '); + l = add_chr_to_str(&s, l, ' '); add_to_str(&s, &l, (unsigned char *)cipher); } return s; diff --git a/links.h b/links.h @@ -257,7 +257,7 @@ void extend_str(unsigned char **s, int n); size_t add_bytes_to_str(unsigned char **, size_t, unsigned char *, size_t); void add_to_str(unsigned char **s, int *l, unsigned char *a); -void add_chr_to_str(unsigned char **s, int *l, unsigned char a); +size_t add_chr_to_str(unsigned char **, size_t, unsigned char); void add_unsigned_num_to_str(unsigned char **s, int *l, off_t n); void add_unsigned_long_num_to_str(unsigned char **s, int *l, unsigned long n); void add_num_to_str(unsigned char **s, int *l, off_t n); diff --git a/menu.c b/menu.c @@ -35,7 +35,7 @@ add_and_pad(unsigned char **s, int *l, struct terminal *term, add_to_str(s, l, x); add_to_str(s, l, cast_uchar ": "); while (len++ < maxlen) - add_chr_to_str(s, l, ' '); + *l = add_chr_to_str(s, *l, ' '); } static void @@ -68,11 +68,11 @@ menu_version(void *term_) add_and_pad(&s, &l, term, *text_ptr++, maxlen); add_to_str(&s, &l, get_text_translation(TEXT_(T_MEMORY), term)); - add_chr_to_str(&s, &l, ' '); + l = add_chr_to_str(&s, l, ' '); add_num_to_str(&s, &l, sizeof(void *) * 8); add_to_str(&s, &l, cast_uchar "-bit, "); add_to_str(&s, &l, get_text_translation(TEXT_(T_FILE_SIZE), term)); - add_chr_to_str(&s, &l, ' '); + l = add_chr_to_str(&s, l, ' '); add_num_to_str(&s, &l, sizeof(off_t) * 8 /*- ((off_t)-1 < 0)*/); add_to_str(&s, &l, cast_uchar "-bit"); add_to_str(&s, &l, cast_uchar "\n"); @@ -315,11 +315,11 @@ resource_info(struct terminal *term, struct refresh *r2) add_to_str(&a, &l, get_text_translation(TEXT_(T_RESOURCES), term)); add_to_str(&a, &l, cast_uchar ": "); add_unsigned_long_num_to_str(&a, &l, select_info(CI_FILES)); - add_chr_to_str(&a, &l, ' '); + l = add_chr_to_str(&a, l, ' '); add_to_str(&a, &l, get_text_translation(TEXT_(T_HANDLES), term)); add_to_str(&a, &l, cast_uchar ", "); add_unsigned_long_num_to_str(&a, &l, select_info(CI_TIMERS)); - add_chr_to_str(&a, &l, ' '); + l = add_chr_to_str(&a, l, ' '); add_to_str(&a, &l, get_text_translation(TEXT_(T_TIMERS), term)); add_to_str(&a, &l, cast_uchar ".\n"); @@ -329,38 +329,38 @@ resource_info(struct terminal *term, struct refresh *r2) connect_info(CI_FILES) - connect_info(CI_CONNECTING) - connect_info(CI_TRANSFER)); - add_chr_to_str(&a, &l, ' '); + l = add_chr_to_str(&a, l, ' '); add_to_str(&a, &l, get_text_translation(TEXT_(T_WAITING), term)); add_to_str(&a, &l, cast_uchar ", "); add_unsigned_long_num_to_str(&a, &l, connect_info(CI_CONNECTING)); - add_chr_to_str(&a, &l, ' '); + l = add_chr_to_str(&a, l, ' '); add_to_str(&a, &l, get_text_translation(TEXT_(T_CONNECTING), term)); add_to_str(&a, &l, cast_uchar ", "); add_unsigned_long_num_to_str(&a, &l, connect_info(CI_TRANSFER)); - add_chr_to_str(&a, &l, ' '); + l = add_chr_to_str(&a, l, ' '); add_to_str(&a, &l, get_text_translation(TEXT_(T_tRANSFERRING), term)); add_to_str(&a, &l, cast_uchar ", "); add_unsigned_long_num_to_str(&a, &l, connect_info(CI_KEEP)); - add_chr_to_str(&a, &l, ' '); + l = add_chr_to_str(&a, l, ' '); add_to_str(&a, &l, get_text_translation(TEXT_(T_KEEPALIVE), term)); add_to_str(&a, &l, cast_uchar ".\n"); add_to_str(&a, &l, get_text_translation(TEXT_(T_MEMORY_CACHE), term)); add_to_str(&a, &l, cast_uchar ": "); add_unsigned_long_num_to_str(&a, &l, cache_info(CI_BYTES)); - add_chr_to_str(&a, &l, ' '); + l = add_chr_to_str(&a, l, ' '); add_to_str(&a, &l, get_text_translation(TEXT_(T_BYTES), term)); add_to_str(&a, &l, cast_uchar ", "); add_unsigned_long_num_to_str(&a, &l, cache_info(CI_FILES)); - add_chr_to_str(&a, &l, ' '); + l = add_chr_to_str(&a, l, ' '); add_to_str(&a, &l, get_text_translation(TEXT_(T_FILES), term)); add_to_str(&a, &l, cast_uchar ", "); add_unsigned_long_num_to_str(&a, &l, cache_info(CI_LOCKED)); - add_chr_to_str(&a, &l, ' '); + l = add_chr_to_str(&a, l, ' '); add_to_str(&a, &l, get_text_translation(TEXT_(T_LOCKED), term)); add_to_str(&a, &l, cast_uchar ", "); add_unsigned_long_num_to_str(&a, &l, cache_info(CI_LOADING)); - add_chr_to_str(&a, &l, ' '); + l = add_chr_to_str(&a, l, ' '); add_to_str(&a, &l, get_text_translation(TEXT_(T_LOADING), term)); add_to_str(&a, &l, cast_uchar ".\n"); @@ -368,15 +368,15 @@ resource_info(struct terminal *term, struct refresh *r2) get_text_translation(TEXT_(T_DECOMPRESSED_CACHE), term)); add_to_str(&a, &l, cast_uchar ": "); add_unsigned_long_num_to_str(&a, &l, decompress_info(CI_BYTES)); - add_chr_to_str(&a, &l, ' '); + l = add_chr_to_str(&a, l, ' '); add_to_str(&a, &l, get_text_translation(TEXT_(T_BYTES), term)); add_to_str(&a, &l, cast_uchar ", "); add_unsigned_long_num_to_str(&a, &l, decompress_info(CI_FILES)); - add_chr_to_str(&a, &l, ' '); + l = add_chr_to_str(&a, l, ' '); add_to_str(&a, &l, get_text_translation(TEXT_(T_FILES), term)); add_to_str(&a, &l, cast_uchar ", "); add_unsigned_long_num_to_str(&a, &l, decompress_info(CI_LOCKED)); - add_chr_to_str(&a, &l, ' '); + l = add_chr_to_str(&a, l, ' '); add_to_str(&a, &l, get_text_translation(TEXT_(T_LOCKED), term)); add_to_str(&a, &l, cast_uchar ".\n"); @@ -385,27 +385,27 @@ resource_info(struct terminal *term, struct refresh *r2) get_text_translation(TEXT_(T_FORMATTED_DOCUMENT_CACHE), term)); add_to_str(&a, &l, cast_uchar ": "); add_unsigned_long_num_to_str(&a, &l, formatted_info(CI_FILES)); - add_chr_to_str(&a, &l, ' '); + l = add_chr_to_str(&a, l, ' '); add_to_str(&a, &l, get_text_translation(TEXT_(T_DOCUMENTS), term)); add_to_str(&a, &l, cast_uchar ", "); add_unsigned_long_num_to_str(&a, &l, formatted_info(CI_LOCKED)); - add_chr_to_str(&a, &l, ' '); + l = add_chr_to_str(&a, l, ' '); add_to_str(&a, &l, get_text_translation(TEXT_(T_LOCKED), term)); add_to_str(&a, &l, cast_uchar ".\n"); add_to_str(&a, &l, get_text_translation(TEXT_(T_DNS_CACHE), term)); add_to_str(&a, &l, cast_uchar ": "); add_unsigned_long_num_to_str(&a, &l, dns_info(CI_FILES)); - add_chr_to_str(&a, &l, ' '); + l = add_chr_to_str(&a, l, ' '); add_to_str(&a, &l, get_text_translation(TEXT_(T_SERVERS), term)); add_to_str(&a, &l, cast_uchar ", "); add_to_str(&a, &l, get_text_translation(TEXT_(T_TLS_SESSION_CACHE), term)); add_to_str(&a, &l, cast_uchar ": "); add_unsigned_long_num_to_str(&a, &l, session_info(CI_FILES)); - add_chr_to_str(&a, &l, ' '); + l = add_chr_to_str(&a, l, ' '); add_to_str(&a, &l, get_text_translation(TEXT_(T_SERVERS), term)); - add_chr_to_str(&a, &l, '.'); + l = add_chr_to_str(&a, l, '.'); if (r2 && !strcmp( @@ -2574,7 +2574,7 @@ query_file(struct session *ses, unsigned char *url, unsigned char *head, def = NULL; add_to_str(&def, &dfl, download_dir); if (*def && !dir_sep(def[strlen(cast_const_char def) - 1])) - add_chr_to_str(&def, &dfl, '/'); + dfl = add_chr_to_str(&def, dfl, '/'); add_to_str(&def, &dfl, file); free(file); diff --git a/select.c b/select.c @@ -435,25 +435,25 @@ add_event_string(unsigned char **s, int *l, struct terminal *term) #else add_to_str(s, l, cast_uchar "LibEvent"); #endif - add_chr_to_str(s, l, ' '); + *l = add_chr_to_str(s, *l, ' '); { #if defined(HAVE_LIBEV) /* old libev report bogus version */ if (!casestrcmp(cast_uchar event_get_version(), cast_uchar "EV_VERSION_MAJOR.EV_VERSION_MINOR")) { add_num_to_str(s, l, ev_version_major()); - add_chr_to_str(s, l, '.'); + *l = add_chr_to_str(s, *l, '.'); add_num_to_str(s, l, ev_version_minor()); } else #endif add_to_str(s, l, cast_uchar event_get_version()); } if (!event_enabled) { - add_chr_to_str(s, l, ' '); + *l = add_chr_to_str(s, *l, ' '); add_to_str(s, l, get_text_translation(TEXT_(T_dISABLED), term)); - add_chr_to_str(s, l, ')'); + *l = add_chr_to_str(s, *l, ')'); } else { - add_chr_to_str(s, l, ' '); + *l = add_chr_to_str(s, *l, ' '); add_to_str(s, l, cast_uchar event_base_get_method(event_base)); } } diff --git a/session.c b/session.c @@ -184,13 +184,13 @@ add_xnum_to_str(unsigned char **s, int *l, off_t n) } add_num_to_str(s, l, n); if (n < 10 && d != -1) { - add_chr_to_str(s, l, '.'); + *l = add_chr_to_str(s, *l, '.'); add_num_to_str(s, l, d); } - add_chr_to_str(s, l, ' '); + *l = add_chr_to_str(s, *l, ' '); if (suff) - add_chr_to_str(s, l, suff); - add_chr_to_str(s, l, 'B'); + *l = add_chr_to_str(s, *l, suff); + *l = add_chr_to_str(s, *l, 'B'); } static void @@ -222,20 +222,20 @@ get_stat_msg(struct status *stat, struct terminal *term) int l = 0; add_to_str(&m, &l, get_text_translation(TEXT_(T_RECEIVED), term)); - add_chr_to_str(&m, &l, ' '); + l = add_chr_to_str(&m, l, ' '); add_xnum_to_str(&m, &l, stat->prg->pos); if (stat->prg->size >= 0) { - add_chr_to_str(&m, &l, ' '); + l = add_chr_to_str(&m, l, ' '); add_to_str(&m, &l, get_text_translation(TEXT_(T_OF), term)); - add_chr_to_str(&m, &l, ' '); + l = add_chr_to_str(&m, l, ' '); add_xnum_to_str(&m, &l, stat->prg->size); } add_to_str(&m, &l, cast_uchar ", "); if (stat->prg->elapsed >= CURRENT_SPD_AFTER * SPD_DISP_TIME) { add_to_str(&m, &l, get_text_translation(TEXT_(T_AVG), term)); - add_chr_to_str(&m, &l, ' '); + l = add_chr_to_str(&m, l, ' '); } add_xnum_to_str(&m, &l, stat->prg->loaded * 10 @@ -245,7 +245,7 @@ get_stat_msg(struct status *stat, struct terminal *term) add_to_str(&m, &l, cast_uchar ", "); add_to_str(&m, &l, get_text_translation(TEXT_(T_CUR), term)); - add_chr_to_str(&m, &l, ' '); + l = add_chr_to_str(&m, l, ' '); add_xnum_to_str( &m, &l, stat->prg->cur_loaded @@ -415,11 +415,11 @@ encode_url(unsigned char *url) add_to_str(&u, &l, cast_uchar "+++"); for (; *url; url++) { if (is_safe_in_shell(*url) && *url != '+') - add_chr_to_str(&u, &l, *url); + l = add_chr_to_str(&u, l, *url); else { - add_chr_to_str(&u, &l, '+'); - add_chr_to_str(&u, &l, hx(*url >> 4)); - add_chr_to_str(&u, &l, hx(*url & 0xf)); + l = add_chr_to_str(&u, l, '+'); + l = add_chr_to_str(&u, l, hx(*url >> 4)); + l = add_chr_to_str(&u, l, hx(*url & 0xf)); } } return u; @@ -437,10 +437,10 @@ decode_url(unsigned char *url) l = 0; for (; *url; url++) { if (*url != '+' || unhx(url[1]) == -1 || unhx(url[2]) == -1) - add_chr_to_str(&u, &l, *url); + l = add_chr_to_str(&u, l, *url); else { - add_chr_to_str(&u, &l, - (unhx(url[1]) << 4) + unhx(url[2])); + l = add_chr_to_str(&u, l, + (unhx(url[1]) << 4) + unhx(url[2])); url += 2; } } @@ -631,12 +631,12 @@ download_percentage(struct download *down, int pad) perc = download_meter(100, stat); if (pad) { if (perc < 10) - add_chr_to_str(&s, &l, ' '); + l = add_chr_to_str(&s, l, ' '); if (perc < 100) - add_chr_to_str(&s, &l, ' '); + l = add_chr_to_str(&s, l, ' '); } add_num_to_str(&s, &l, perc); - add_chr_to_str(&s, &l, '%'); + l = add_chr_to_str(&s, l, '%'); return s; } @@ -659,15 +659,15 @@ download_window_function(struct dialog_data *dlg) t = 1; add_to_str(&m, &l, get_text_translation(TEXT_(T_RECEIVED), term)); - add_chr_to_str(&m, &l, ' '); + l = add_chr_to_str(&m, l, ' '); add_xnum_to_str(&m, &l, stat->prg->pos); if (stat->prg->size >= 0) { - add_chr_to_str(&m, &l, ' '); + l = add_chr_to_str(&m, l, ' '); add_to_str(&m, &l, get_text_translation(TEXT_(T_OF), term)); - add_chr_to_str(&m, &l, ' '); + l = add_chr_to_str(&m, l, ' '); add_xnum_to_str(&m, &l, stat->prg->size); - add_chr_to_str(&m, &l, ' '); + l = add_chr_to_str(&m, l, ' '); } add_to_str(&m, &l, cast_uchar "\n"); if (stat->prg->elapsed >= CURRENT_SPD_AFTER * SPD_DISP_TIME) @@ -677,7 +677,7 @@ download_window_function(struct dialog_data *dlg) else add_to_str(&m, &l, get_text_translation(TEXT_(T_SPEED), term)); - add_chr_to_str(&m, &l, ' '); + l = add_chr_to_str(&m, l, ' '); add_xnum_to_str(&m, &l, (long long)stat->prg->loaded * 10 / (stat->prg->elapsed / 100)); @@ -687,7 +687,7 @@ download_window_function(struct dialog_data *dlg) add_to_str( &m, &l, get_text_translation(TEXT_(T_CURRENT_SPEED), term)); - add_chr_to_str(&m, &l, ' '); + l = add_chr_to_str(&m, l, ' '); add_xnum_to_str( &m, &l, stat->prg->cur_loaded @@ -697,14 +697,14 @@ download_window_function(struct dialog_data *dlg) add_to_str(&m, &l, cast_uchar "\n"); add_to_str(&m, &l, get_text_translation(TEXT_(T_ELAPSED_TIME), term)); - add_chr_to_str(&m, &l, ' '); + l = add_chr_to_str(&m, l, ' '); add_time_to_str(&m, &l, stat->prg->elapsed / 1000); if (stat->prg->size >= 0 && stat->prg->loaded > 0) { add_to_str(&m, &l, cast_uchar ", "); add_to_str(&m, &l, get_text_translation(TEXT_(T_ESTIMATED_TIME), term)); - add_chr_to_str(&m, &l, ' '); + l = add_chr_to_str(&m, l, ' '); /*add_time_to_str(&m, &l, stat->prg->elapsed / 1000 * * stat->prg->size / stat->prg->loaded * 1000 - * stat->prg->elapsed);*/ diff --git a/string.c b/string.c @@ -119,10 +119,10 @@ add_to_str(unsigned char **s, int *l, unsigned char *a) *l = add_bytes_to_str(s, *l, a, strlen(cast_const_char a)); } -void -add_chr_to_str(unsigned char **s, int *l, unsigned char a) +size_t +add_chr_to_str(unsigned char **s, size_t sl, unsigned char a) { - *l = add_bytes_to_str(s, *l, &a, 1); + return add_bytes_to_str(s, sl, &a, 1); } void diff --git a/terminal.c b/terminal.c @@ -594,9 +594,9 @@ static unsigned char frame_vt100[49] = { \ add_to_str(&a, &l, cast_uchar "\033["); \ add_num_to_str(&a, &l, (y) + 1 + term->top_margin); \ - add_chr_to_str(&a, &l, ';'); \ + l = add_chr_to_str(&a, l, ';'); \ add_num_to_str(&a, &l, (x) + 1 + term->left_margin); \ - add_chr_to_str(&a, &l, 'H'); \ + l = add_chr_to_str(&a, l, 'H'); \ n_chars = 0; \ } @@ -636,11 +636,11 @@ static unsigned char frame_vt100[49] = add_to_str(&a, &l, cast_uchar ";7"); \ if (attrib & 0100) \ add_to_str(&a, &l, cast_uchar ";1"); \ - add_chr_to_str(&a, &l, 'm'); \ + l = add_chr_to_str(&a, l, 'm'); \ } \ if (c >= ' ' && c != 127 && c != 155) { \ if (c < 128 || frm) { \ - add_chr_to_str(&a, &l, (unsigned char)c); \ + l = add_chr_to_str(&a, l, (unsigned char)c); \ } else { \ /* \ * Linux UTF-8 console is broken and doesn't \ @@ -653,9 +653,9 @@ static unsigned char frame_vt100[49] = r = u2cp(c); \ if (!(r && r[0] >= 32 && r[0] < 127 && !r[1])) \ r = cast_uchar "*"; \ - add_chr_to_str(&a, &l, r[0]); \ + l = add_chr_to_str(&a, l, r[0]); \ if (cx + 1 < term->x) \ - add_chr_to_str(&a, &l, 8); \ + l = add_chr_to_str(&a, l, 8); \ else \ SETPOS(cx, y); \ add_to_str(&a, &l, encode_utf_8(c)); \ @@ -663,9 +663,9 @@ static unsigned char frame_vt100[49] = print_next = 1; \ } \ } else if (!c || c == 1) \ - add_chr_to_str(&a, &l, ' '); \ + l = add_chr_to_str(&a, l, ' '); \ else \ - add_chr_to_str(&a, &l, '.'); \ + l = add_chr_to_str(&a, l, '.'); \ cx++; \ n_chars++; \ } @@ -749,9 +749,9 @@ pc: term->lcy = term->cy; add_to_str(&a, &l, cast_uchar "\033["); add_num_to_str(&a, &l, term->cy + 1 + term->top_margin); - add_chr_to_str(&a, &l, ';'); + l = add_chr_to_str(&a, l, ';'); add_num_to_str(&a, &l, term->cx + 1 + term->left_margin); - add_chr_to_str(&a, &l, 'H'); + l = add_chr_to_str(&a, l, 'H'); } hard_write(term->fdout, a, l); free(a); @@ -1048,10 +1048,9 @@ exec_on_terminal(struct terminal *term, unsigned char *path, return; } param = NULL; - paraml = 0; - add_chr_to_str(&param, &paraml, fg); + paraml = add_chr_to_str(&param, 0, fg); add_to_str(&param, &paraml, path); - add_chr_to_str(&param, &paraml, 0); + paraml = add_chr_to_str(&param, paraml, 0); add_to_str(&param, &paraml, delet); if (fg == 1) block_itrm(term->fdin); @@ -1078,11 +1077,10 @@ exec_on_terminal(struct terminal *term, unsigned char *path, unsigned char *data; int datal; data = NULL; - datal = 0; - add_chr_to_str(&data, &datal, 0); - add_chr_to_str(&data, &datal, fg); + datal = add_chr_to_str(&data, 0, 0); + datal = add_chr_to_str(&data, datal, fg); add_to_str(&data, &datal, path); - add_chr_to_str(&data, &datal, 0); + datal = add_chr_to_str(&data, datal, 0); add_to_str(&data, &datal, delet); hard_write(term->fdout, data, datal + 1); free(data); @@ -1096,8 +1094,7 @@ do_terminal_function(struct terminal *term, unsigned char code, unsigned char *x_data; int x_datal; x_data = NULL; - x_datal = 0; - add_chr_to_str(&x_data, &x_datal, code); + x_datal = add_chr_to_str(&x_data, 0, code); add_to_str(&x_data, &x_datal, data); exec_on_terminal(term, NULL, x_data, 0); free(x_data); diff --git a/url.c b/url.c @@ -419,9 +419,9 @@ free_u_ret_up: if (q && (data[q - 1] == '&' || data[q - 1] == '?')) ; else if (strchr((char *)data, '?')) - add_chr_to_str(&r, &rl, '&'); + rl = add_chr_to_str(&r, rl, '&'); else - add_chr_to_str(&r, &rl, '?'); + rl = add_chr_to_str(&r, rl, '?'); add_to_str(&r, &rl, cast_uchar "_escaped_fragment_="); for (; *dp; dp++) { unsigned char c = *dp; @@ -431,7 +431,7 @@ free_u_ret_up: sprintf((char *)h, "%%%02X", c); add_to_str(&r, &rl, h); } else - add_chr_to_str(&r, &rl, c); + rl = add_chr_to_str(&r, rl, c); } add_to_str(&r, &rl, post_seq); free(u); @@ -589,10 +589,10 @@ insert_wd(unsigned char **up, unsigned char *cwd) sprintf((char *)h, "%%%02X", (unsigned)c & 0xff); add_to_str(&url, &url_l, h); } else - add_chr_to_str(&url, &url_l, c); + url_l = add_chr_to_str(&url, url_l, c); } if (!dir_sep(cwd[strlen((char *)cwd) - 1])) - add_chr_to_str(&url, &url_l, '/'); + url_l = add_chr_to_str(&url, url_l, '/'); add_to_str(&url, &url_l, u + 7); free(u); *up = url; @@ -914,13 +914,13 @@ add_conv_str(unsigned char **s, int *l, unsigned char *b, int ll, if (chr == ' ' && (!encode_special || encode_special == -1)) add_to_str(s, l, cast_uchar "&nbsp;"); else if (accept_char(chr) || encode_special == -2) - add_chr_to_str(s, l, chr); + *l = add_chr_to_str(s, *l, chr); else if (chr == 10 || chr == 13) { continue; } else { add_to_str(s, l, cast_uchar "&#"); add_num_to_str(s, l, (int)chr); - add_chr_to_str(s, l, ';'); + *l = add_chr_to_str(s, *l, ';'); } } } @@ -1045,7 +1045,7 @@ puny_encode(unsigned char *s, int len) ni = 0; for (i = 0; i < uni_l; i++) if (uni[i] < 128) { - add_chr_to_str(&res, &res_l, uni[i]); + res_l = add_chr_to_str(&res, res_l, uni[i]); ni++; } @@ -1056,7 +1056,7 @@ puny_encode(unsigned char *s, int len) } if (res_l != xn_l) - add_chr_to_str(&res, &res_l, '-'); + res_l = add_chr_to_str(&res, res_l, '-'); puny_init(&st, ni); @@ -1086,15 +1086,16 @@ puny_encode(unsigned char *s, int len) while (1) { unsigned t = puny_threshold(&st); if (n < t) { - add_chr_to_str(&res, &res_l, - puny_chrenc(n)); + res_l = add_chr_to_str( + &res, res_l, + puny_chrenc(n)); break; } else { unsigned d = (n - t) % (puny_base - t); n = (n - t) / (puny_base - t); - add_chr_to_str( - &res, &res_l, + res_l = add_chr_to_str( + &res, res_l, puny_chrenc(d + t)); } } @@ -1266,7 +1267,7 @@ next_host_elem: advance_host: if (l != len) { - add_chr_to_str(&p, &pl, host[l]); + pl = add_chr_to_str(&p, pl, host[l]); host += l + 1; len -= l + 1; goto next_host_elem; diff --git a/view.c b/view.c @@ -1715,7 +1715,7 @@ encode_textarea(unsigned char *t) unsigned char *o = NULL; for (; *t; t++) { if (*t != '\n') - add_chr_to_str(&o, &len, *t); + len = add_chr_to_str(&o, len, *t); else add_to_str(&o, &len, cast_uchar "\r\n"); } @@ -1859,9 +1859,9 @@ encode_string(unsigned char *name, unsigned char **data, int *len) { for (; *name; name++) { if (*name == ' ') - add_chr_to_str(data, len, '+'); + *len = add_chr_to_str(data, *len, '+'); else if (safe_char(*name)) - add_chr_to_str(data, len, *name); + *len = add_chr_to_str(data, *len, *name); else { unsigned char n[4]; sprintf(cast_char n, "%%%02X", *name); @@ -1883,11 +1883,11 @@ encode_controls(struct list_head *l, unsigned char **data, int *len, foreach (struct submitted_value, sv, lsv, *l) { unsigned char *p = sv->value; if (lst) - add_chr_to_str(data, len, '&'); + *len = add_chr_to_str(data, *len, '&'); else lst = 1; encode_string(sv->name, data, len); - add_chr_to_str(data, len, '='); + *len = add_chr_to_str(data, *len, '='); if (sv->type == FC_TEXT || sv->type == FC_PASSWORD || sv->type == FC_TEXTAREA) p2 = convert(cp_from, cp_to, p, NULL); @@ -2135,7 +2135,7 @@ get_form_url(struct session *ses, struct f_data_c *f, struct form_control *form, int i; go = NULL; add_to_str(&go, &l, form->action); - add_chr_to_str(&go, &l, POST_CHAR); + l = add_chr_to_str(&go, l, POST_CHAR); if (form->method == FM_POST) add_to_str(&go, &l, cast_uchar @@ -2183,7 +2183,7 @@ get_link_url(struct session *ses, struct f_data_c *f, struct link *l, &nu, 0, l->where, strlen(cast_const_char l->where) - 3); add_num_to_str(&nu, &ll, ismap_x); - add_chr_to_str(&nu, &ll, ','); + ll = add_chr_to_str(&nu, ll, ','); add_num_to_str(&nu, &ll, ismap_y); return nu; } @@ -3878,7 +3878,7 @@ send_open_in_new_xterm(struct terminal *term, void *open_window_, void *ses_) add_to_str(&p, &pl, cast_uchar "-base-session "); add_num_to_str(&p, &pl, ses->id); - add_chr_to_str(&p, &pl, ' '); + pl = add_chr_to_str(&p, pl, ' '); if (ses->wtd_target && *ses->wtd_target) { unsigned char *tgt = stracpy(ses->wtd_target); @@ -3886,7 +3886,7 @@ send_open_in_new_xterm(struct terminal *term, void *open_window_, void *ses_) check_shell_security(&tgt); add_to_str(&p, &pl, cast_uchar "-target "); add_to_str(&p, &pl, tgt); - add_chr_to_str(&p, &pl, ' '); + pl = add_chr_to_str(&p, pl, ' '); free(tgt); } enc_url = encode_url(ses->dn_url); @@ -4200,7 +4200,7 @@ print_current_titlex(struct f_data_c *fd, int w) if (fd->vs->view_pos + fd->yw >= fd->f_data->y) pp = pe; if (fd->f_data->title) - add_chr_to_str(&p, &pl, ' '); + pl = add_chr_to_str(&p, pl, ' '); add_to_str( &p, &pl, get_text_translation(TEXT_(T_PAGE_P), fd->ses->term)); @@ -4266,7 +4266,7 @@ print_current_linkx(struct f_data_c *fd, struct terminal *term) add_to_str( &m, &ll, get_text_translation(TEXT_(T_IMAGE), term)); - add_chr_to_str(&m, &ll, ' '); + ll = add_chr_to_str(&m, ll, ' '); d = display_url(term, l->where_img, 1); add_to_str(&m, &ll, d); free(d); @@ -4279,7 +4279,7 @@ print_current_linkx(struct f_data_c *fd, struct terminal *term) ll = 0; add_to_str(&m, &ll, get_text_translation(TEXT_(T_USEMAP), term)); - add_chr_to_str(&m, &ll, ' '); + ll = add_chr_to_str(&m, ll, ' '); d = display_url(term, l->where + 4, 1); add_to_str(&m, &ll, d); free(d); @@ -4319,7 +4319,7 @@ print_current_linkx(struct f_data_c *fd, struct terminal *term) add_to_str( &m, &ll, get_text_translation(TEXT_(T_POST_FORM_TO), term)); - add_chr_to_str(&m, &ll, ' '); + ll = add_chr_to_str(&m, ll, ' '); add_to_str(&m, &ll, l->form->action); goto p; } @@ -4370,7 +4370,7 @@ print_current_linkx(struct f_data_c *fd, struct terminal *term) add_to_str(&m, &ll, cast_uchar ", "); add_to_str(&m, &ll, get_text_translation(TEXT_(T_NAME), term)); - add_chr_to_str(&m, &ll, ' '); + ll = add_chr_to_str(&m, ll, ' '); add_to_str(&m, &ll, l->form->name); } if ((l->form->type == FC_CHECKBOX || l->form->type == FC_RADIO) @@ -4378,7 +4378,7 @@ print_current_linkx(struct f_data_c *fd, struct terminal *term) add_to_str(&m, &ll, cast_uchar ", "); add_to_str(&m, &ll, get_text_translation(TEXT_(T_VALUE), term)); - add_chr_to_str(&m, &ll, ' '); + ll = add_chr_to_str(&m, ll, ' '); add_to_str(&m, &ll, l->form->default_value); } /* pri enteru se bude posilat vzdycky -- Brain */ @@ -4388,7 +4388,7 @@ print_current_linkx(struct f_data_c *fd, struct terminal *term) add_to_str( &m, &ll, get_text_translation(TEXT_(T_HIT_ENTER_TO), term)); - add_chr_to_str(&m, &ll, ' '); + ll = add_chr_to_str(&m, ll, ' '); if (l->form->method == FM_GET) add_to_str(&m, &ll, get_text_translation( @@ -4397,7 +4397,7 @@ print_current_linkx(struct f_data_c *fd, struct terminal *term) add_to_str(&m, &ll, get_text_translation( TEXT_(T_POST_TO), term)); - add_chr_to_str(&m, &ll, ' '); + ll = add_chr_to_str(&m, ll, ' '); add_to_str(&m, &ll, l->form->action); } goto p; @@ -4434,7 +4434,7 @@ print_current_linkx_plus(struct f_data_c *fd, struct terminal *term) && !casecmp(l->where, cast_uchar "MAP@", 4)) { add_to_str(&m, &ll, get_text_translation(TEXT_(T_USEMAP), term)); - add_chr_to_str(&m, &ll, ' '); + ll = add_chr_to_str(&m, ll, ' '); d = display_url(term, l->where + 4, 1); add_to_str(&m, &ll, d); free(d); @@ -4461,7 +4461,7 @@ print_current_linkx_plus(struct f_data_c *fd, struct terminal *term) d = display_url(term, l->where_img, 1); add_to_str(&m, &ll, d); free(d); - add_chr_to_str(&m, &ll, '\''); + ll = add_chr_to_str(&m, ll, '\''); if (l->img_alt) { unsigned char *txt; @@ -4471,7 +4471,7 @@ print_current_linkx_plus(struct f_data_c *fd, struct terminal *term) convert(fd->f_data->cp, fd->f_data->opt.cp, l->img_alt, &fd->f_data->opt); add_to_str(&m, &ll, txt); - add_chr_to_str(&m, &ll, '\''); + ll = add_chr_to_str(&m, ll, '\''); free(txt); } goto p; @@ -4505,7 +4505,7 @@ print_current_linkx_plus(struct f_data_c *fd, struct terminal *term) add_to_str( &m, &ll, get_text_translation(TEXT_(T_POST_FORM_TO), term)); - add_chr_to_str(&m, &ll, ' '); + ll = add_chr_to_str(&m, ll, ' '); add_to_str(&m, &ll, l->form->action); goto p; } @@ -4556,7 +4556,7 @@ print_current_linkx_plus(struct f_data_c *fd, struct terminal *term) add_to_str(&m, &ll, cast_uchar ", "); add_to_str(&m, &ll, get_text_translation(TEXT_(T_NAME), term)); - add_chr_to_str(&m, &ll, ' '); + ll = add_chr_to_str(&m, ll, ' '); add_to_str(&m, &ll, l->form->name); } if ((l->form->type == FC_CHECKBOX || l->form->type == FC_RADIO) @@ -4564,7 +4564,7 @@ print_current_linkx_plus(struct f_data_c *fd, struct terminal *term) add_to_str(&m, &ll, cast_uchar ", "); add_to_str(&m, &ll, get_text_translation(TEXT_(T_VALUE), term)); - add_chr_to_str(&m, &ll, ' '); + ll = add_chr_to_str(&m, ll, ' '); add_to_str(&m, &ll, l->form->default_value); } /* pri enteru se bude posilat vzdycky -- Brain */ @@ -4574,7 +4574,7 @@ print_current_linkx_plus(struct f_data_c *fd, struct terminal *term) add_to_str( &m, &ll, get_text_translation(TEXT_(T_HIT_ENTER_TO), term)); - add_chr_to_str(&m, &ll, ' '); + ll = add_chr_to_str(&m, ll, ' '); if (l->form->method == FM_GET) add_to_str(&m, &ll, get_text_translation( @@ -4583,7 +4583,7 @@ print_current_linkx_plus(struct f_data_c *fd, struct terminal *term) add_to_str(&m, &ll, get_text_translation( TEXT_(T_POST_TO), term)); - add_chr_to_str(&m, &ll, ' '); + ll = add_chr_to_str(&m, ll, ' '); add_to_str(&m, &ll, l->form->action); } goto p; @@ -4650,13 +4650,13 @@ loc_msg(struct terminal *term, struct location *lo, struct f_data_c *frame) if (enc) { add_to_str(&s, &l, cast_uchar " ("); add_num_to_str(&s, &l, ce->length); - add_chr_to_str(&s, &l, ' '); + l = add_chr_to_str(&s, l, ' '); add_to_str(&s, &l, get_text_translation( TEXT_(T_COMPRESSED_WITH), term)); - add_chr_to_str(&s, &l, ' '); + l = add_chr_to_str(&s, l, ' '); add_to_str(&s, &l, enc); - add_chr_to_str(&s, &l, ')'); + l = add_chr_to_str(&s, l, ')'); free(enc); } } else { @@ -4667,7 +4667,7 @@ loc_msg(struct terminal *term, struct location *lo, struct f_data_c *frame) add_to_str( &s, &l, get_text_translation(TEXT_(T_INCOMPLETE), term)); - add_chr_to_str(&s, &l, ')'); + l = add_chr_to_str(&s, l, ')'); } if (frame->f_data->ass >= 0) { add_to_str(&s, &l, cast_uchar "\n"); @@ -4681,7 +4681,7 @@ loc_msg(struct terminal *term, struct location *lo, struct f_data_c *frame) add_to_str(&s, &l, get_text_translation( TEXT_(T_ASSUMED), term)); - add_chr_to_str(&s, &l, ')'); + l = add_chr_to_str(&s, l, ')'); } if (frame->f_data->ass == 2) { add_to_str(&s, &l, cast_uchar " ("); @@ -4689,7 +4689,7 @@ loc_msg(struct terminal *term, struct location *lo, struct f_data_c *frame) get_text_translation( TEXT_(T_IGNORING_SERVER_SETTING), term)); - add_chr_to_str(&s, &l, ')'); + l = add_chr_to_str(&s, l, ')'); } } if (ce->head && ce->head[0] != '\n' && ce->head[0] != '\r'