From 068663783c2c5a3ed014454eb02e97c44d182ac0 Mon Sep 17 00:00:00 2001 From: Kalle Olavi Niemitalo Date: Tue, 2 Jan 2007 00:47:38 +0200 Subject: [PATCH] insert_in_string: Let the seq parameter point to const. It is the data to be inserted into the other string. --- src/util/string.c | 3 ++- src/util/string.h | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/util/string.c b/src/util/string.c index b8865568..ab486ff4 100644 --- a/src/util/string.c +++ b/src/util/string.c @@ -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); diff --git a/src/util/string.h b/src/util/string.h index 4e04bac6..215f2ba9 100644 --- a/src/util/string.h +++ b/src/util/string.h @@ -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. */