mirror of
https://github.com/rkd77/elinks.git
synced 2025-01-03 14:57:44 -05: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:
parent
10f1bd0efc
commit
068663783c
@ -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);
|
||||
|
@ -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. */
|
||||
|
Loading…
Reference in New Issue
Block a user