summaryrefslogtreecommitdiff
path: root/src/common/extstr.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/extstr.c')
-rw-r--r--src/common/extstr.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/common/extstr.c b/src/common/extstr.c
index ac93f5d..bd3491f 100644
--- a/src/common/extstr.c
+++ b/src/common/extstr.c
@@ -55,7 +55,7 @@ char *stradd(char *str1, const char *str2)
else
{
- result = (char *)realloc(str1, (strlen(str1) + strlen(str2) + 1) * sizeof(char));
+ result = realloc(str1, (strlen(str1) + strlen(str2) + 1) * sizeof(char));
strcat(result, str2);
}
@@ -87,7 +87,7 @@ char *strnadd(char *str1, const char *str2, size_t n)
else
{
- result = (char *)realloc(str1, (strlen(str1) + n + 1) * sizeof(char));
+ result = realloc(str1, (strlen(str1) + n + 1) * sizeof(char));
strncat(result, str2, n);
}
@@ -155,7 +155,7 @@ char *strprep(char *str1, const char *str2)
char *result; /* Chaîne à renvoyer */
size_t len2; /* Taille de la seconde chaîne */
- result = (char *)realloc(str1, (strlen(str1) + strlen(str2) + 1) * sizeof(char));
+ result = realloc(str1, (strlen(str1) + strlen(str2) + 1) * sizeof(char));
len2 = strlen(str2);
@@ -261,7 +261,7 @@ char *strrpl(char *haystack, const char *needle1, const char *needle2)
{
inlen += (len2 - len1);
- haystack = (char *)realloc(haystack, inlen * sizeof(char *));
+ haystack = realloc(haystack, inlen * sizeof(char *));
found = haystack + index;
memmove(found + len2, found + len1, inlen - len2 - index);
@@ -274,7 +274,7 @@ char *strrpl(char *haystack, const char *needle1, const char *needle2)
inlen -= (len1 - len2);
- haystack = (char *)realloc(haystack, inlen * sizeof(char *));
+ haystack = realloc(haystack, inlen * sizeof(char *));
found = haystack + index;
}
@@ -390,7 +390,7 @@ char **strtoka(const char *str, const char *delim, size_t *count)
for (word = strtok(tmp, delim); word != NULL; word = strtok(NULL, delim))
{
- result = (char **)realloc(result, ++(*count) * sizeof(char *));
+ result = realloc(result, ++(*count) * sizeof(char *));
result[*count - 1] = strdup(word);
}
@@ -428,7 +428,7 @@ char *escape_crlf(char *input)
for (curpos = 0; regexec(&preg, &input[curpos], 2, pmatch, 0) != REG_NOMATCH; )
{
inlen += 1 + 1;
- input = (char *)realloc(input, inlen * sizeof(char *));
+ input = realloc(input, inlen * sizeof(char *));
memmove(&input[curpos + pmatch[1].rm_eo + 1], &input[curpos + pmatch[1].rm_eo], inlen - 1 - curpos - pmatch[1].rm_eo);