mirror of
https://github.com/rkd77/elinks.git
synced 2025-01-03 14:57:44 -05:00
straconcat: Assume all arguments point to const.
This commit is contained in:
parent
03ccf0b2b1
commit
0ee76a0ef3
@ -132,10 +132,10 @@ insert_in_string(unsigned char **dst, int pos,
|
|||||||
}
|
}
|
||||||
|
|
||||||
unsigned char *
|
unsigned char *
|
||||||
straconcat(unsigned char *str, ...)
|
straconcat(const unsigned char *str, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
unsigned char *a;
|
const unsigned char *a;
|
||||||
unsigned char *s;
|
unsigned char *s;
|
||||||
unsigned int len;
|
unsigned int len;
|
||||||
|
|
||||||
@ -149,7 +149,7 @@ straconcat(unsigned char *str, ...)
|
|||||||
if (len) memcpy(s, str, len);
|
if (len) memcpy(s, str, len);
|
||||||
|
|
||||||
va_start(ap, str);
|
va_start(ap, str);
|
||||||
while ((a = va_arg(ap, unsigned char *))) {
|
while ((a = va_arg(ap, const unsigned char *))) {
|
||||||
unsigned int l = strlen(a);
|
unsigned int l = strlen(a);
|
||||||
unsigned char *ns;
|
unsigned char *ns;
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ unsigned char *insert_in_string(unsigned char **dst, int pos,
|
|||||||
* if (abc) return;
|
* if (abc) return;
|
||||||
* printf("%s", abc); -> print "ABC"
|
* printf("%s", abc); -> print "ABC"
|
||||||
* mem_free(abc); -> free memory used by @abc */
|
* mem_free(abc); -> free memory used by @abc */
|
||||||
unsigned char *straconcat(unsigned char *str, ...);
|
unsigned char *straconcat(const unsigned char *str, ...);
|
||||||
|
|
||||||
|
|
||||||
/* Misc. utility string functions. */
|
/* Misc. utility string functions. */
|
||||||
|
Loading…
Reference in New Issue
Block a user