1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

Use add_string_to_string where applicable.

This commit is contained in:
Kalle Olavi Niemitalo 2007-03-18 20:25:18 +02:00 committed by Kalle Olavi Niemitalo
parent 4a23d7fd82
commit 44adb76799
3 changed files with 5 additions and 6 deletions

View File

@ -767,7 +767,7 @@ create_config_string(unsigned char *prefix, unsigned char *name,
smart_config_string(&tmpstring, 2, i18n, options->value.tree, NULL, 0,
smart_config_output_fn);
if (tmpstring.length > origlen)
add_bytes_to_string(&config, tmpstring.source, tmpstring.length);
add_string_to_string(&config, &tmpstring);
done_string(&tmpstring);
if (!init_string(&tmpstring)) goto get_me_out;
@ -778,7 +778,7 @@ create_config_string(unsigned char *prefix, unsigned char *name,
origlen = tmpstring.length;
bind_config_string(&tmpstring);
if (tmpstring.length > origlen)
add_bytes_to_string(&config, tmpstring.source, tmpstring.length);
add_string_to_string(&config, &tmpstring);
done_string(&tmpstring);
get_me_out:

View File

@ -65,10 +65,8 @@ init_directory_listing(struct string *page, struct uri *uri)
&& !add_char_to_string(&dirpath, local ? CHAR_DIR_SEP : '/'))
goto out_of_memory;
/* Decode uri for displaying. Do not use
* add_string_to_string, because it for some reason returns
* NULL if the second string is empty. */
if (!add_bytes_to_string(&decoded, dirpath.source, dirpath.length))
/* Decode uri for displaying. */
if (!add_string_to_string(&decoded, &dirpath))
goto out_of_memory;
decode_uri_string(&decoded);

View File

@ -73,6 +73,7 @@ static const unsigned char frame_restrict[48] = {
#define TERM_STRING(str) INIT_STRING(str, sizeof(str) - 1)
/* Like add_string_to_string but has fewer checks to slow it down. */
#define add_term_string(str, tstr) \
add_bytes_to_string(str, (tstr).source, (tstr).length)