1
0
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:
Kalle Olavi Niemitalo 2007-01-28 01:42:08 +02:00 committed by Kalle Olavi Niemitalo
parent 03ccf0b2b1
commit 0ee76a0ef3
2 changed files with 4 additions and 4 deletions

View File

@ -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;

View File

@ -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. */