mirror of
https://github.com/rkd77/elinks.git
synced 2024-10-03 03:56:32 -04: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 *
|
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);
|
int dstlen = strlen(*dst);
|
||||||
unsigned char *string = mem_realloc(*dst, dstlen + seqlen + 1);
|
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. */
|
/* 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. */
|
/* If reallocation of @dst fails it is not touched and NULL is returned. */
|
||||||
unsigned char *
|
unsigned char *insert_in_string(unsigned char **dst, int pos,
|
||||||
insert_in_string(unsigned char **dst, int pos, unsigned char *seq, int seqlen);
|
const unsigned char *seq, int seqlen);
|
||||||
|
|
||||||
/* Takes a list of strings where the last parameter _must_ be NULL and
|
/* Takes a list of strings where the last parameter _must_ be NULL and
|
||||||
* concatenates them. */
|
* concatenates them. */
|
||||||
|
Loading…
Reference in New Issue
Block a user