1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-07-04 02:35:29 +00:00

insert_in_string: Let the seq parameter point to const.

It is the data to be inserted into the other string.
This commit is contained in:
Kalle Olavi Niemitalo 2007-01-02 00:47:38 +02:00 committed by Kalle Olavi Niemitalo
parent 10f1bd0efc
commit 068663783c
2 changed files with 4 additions and 3 deletions

View File

@ -116,7 +116,8 @@ add_to_strn(unsigned char **dst, unsigned char *src)
}
unsigned char *
insert_in_string(unsigned char **dst, int pos, unsigned char *seq, int seqlen)
insert_in_string(unsigned char **dst, int pos,
const unsigned char *seq, int seqlen)
{
int dstlen = strlen(*dst);
unsigned char *string = mem_realloc(*dst, dstlen + seqlen + 1);

View File

@ -47,8 +47,8 @@ void add_to_strn(unsigned char **str, unsigned char *src);
/* Inserts @seqlen chars from @seq at position @pos in the @dst string. */
/* If reallocation of @dst fails it is not touched and NULL is returned. */
unsigned char *
insert_in_string(unsigned char **dst, int pos, unsigned char *seq, int seqlen);
unsigned char *insert_in_string(unsigned char **dst, int pos,
const unsigned char *seq, int seqlen);
/* Takes a list of strings where the last parameter _must_ be NULL and
* concatenates them. */