mirror of
https://github.com/rkd77/elinks.git
synced 2024-11-04 08:17:17 -05:00
Revert "strcpy -> strlcpy."
This reverts commit 365cbb61be
.
There is no strlcpy in libc.
This commit is contained in:
parent
365cbb61be
commit
f93d5ccd80
@ -206,12 +206,10 @@ set_language(int language)
|
||||
/* We never free() this, purely intentionally. */
|
||||
LANGUAGE = malloc(256);
|
||||
}
|
||||
if (LANGUAGE) {
|
||||
strlcpy(LANGUAGE, language_to_iso639(language), 256);
|
||||
p = strchr(LANGUAGE, '-');
|
||||
if (p)
|
||||
*p = '_';
|
||||
}
|
||||
strcpy(LANGUAGE, language_to_iso639(language));
|
||||
p = strchr(LANGUAGE, '-');
|
||||
if (p)
|
||||
*p = '_';
|
||||
|
||||
/* Propagate the change to gettext. From the info manual. */
|
||||
{
|
||||
|
@ -142,9 +142,10 @@ __(unsigned char *file, unsigned int line, unsigned char *func,
|
||||
file, line, func, last_line);
|
||||
}
|
||||
|
||||
strlcpy(last_file, file, 512);
|
||||
strlcpy(last_func, func, 1024);
|
||||
strlcpy(last_result, result, 16384);
|
||||
/* Risky ;) */
|
||||
strcpy(last_file, file);
|
||||
strcpy(last_func, func);
|
||||
strcpy(last_result, result);
|
||||
last_line = line;
|
||||
|
||||
return result;
|
||||
|
@ -155,9 +155,9 @@ get_charset_aliases(void)
|
||||
res_size = 0;
|
||||
break;
|
||||
}
|
||||
strlcpy(res_ptr + res_size - (l2 + 1) - (l1 + 1),
|
||||
buf1, l1 + 1 + l2 + 1 + 1);
|
||||
strlcpy(res_ptr + res_size - (l2 + 1), buf2, l2 + 1);
|
||||
strcpy(res_ptr + res_size - (l2 + 1) - (l1 + 1),
|
||||
buf1);
|
||||
strcpy(res_ptr + res_size - (l2 + 1), buf2);
|
||||
}
|
||||
fclose(fp);
|
||||
if (res_size == 0)
|
||||
|
@ -874,7 +874,6 @@ join_urls(struct uri *base, unsigned char *rel)
|
||||
int add_slash = 0;
|
||||
int translate = 0;
|
||||
int length = 0;
|
||||
int rel_len;
|
||||
|
||||
/* See RFC 1808 */
|
||||
/* TODO: Support for ';' ? (see the RFC) --pasky */
|
||||
@ -989,13 +988,12 @@ join_urls(struct uri *base, unsigned char *rel)
|
||||
}
|
||||
|
||||
length = path - struri(base);
|
||||
rel_len = strlen(rel);
|
||||
uristring = mem_alloc(length + rel_len + add_slash + 1);
|
||||
uristring = mem_alloc(length + strlen(rel) + add_slash + 1);
|
||||
if (!uristring) return NULL;
|
||||
|
||||
memcpy(uristring, struri(base), length);
|
||||
if (add_slash) uristring[length] = '/';
|
||||
strlcpy(uristring + length + add_slash, rel, rel_len + 1);
|
||||
strcpy(uristring + length + add_slash, rel);
|
||||
|
||||
return normalize_uri_reparse(uristring);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user