aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/xstd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/xstd.c b/src/xstd.c
index f06f639..309412c 100644
--- a/src/xstd.c
+++ b/src/xstd.c
@@ -24,10 +24,10 @@
char *xstrcat(const char *first, const char *second,
const char *delimiter)
{
- size_t size = sizeof(char) * (strlen(first) + strlen(second) + 1);
+ size_t size = strlen(first) + strlen(second) + 1;
if(delimiter)
- size += sizeof(char) * strlen(delimiter);
- char *res = malloc(size);
+ size += strlen(delimiter);
+ char *res = malloc(size * sizeof(char));
strcpy(res, first);
if(delimiter)
strcat(res, delimiter);