Handle streams separately in tree_add_track()
[cmus.git] / xstrjoin.c
blobaad6bd53b75aa2366727090c4aafec0c74bdafbc
1 /*
2 * Copyright 2004 Timo Hirvonen
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of the
7 * License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
17 * 02111-1307, USA.
20 #include "xstrjoin.h"
21 #include "xmalloc.h"
22 #include "string.h"
24 char *xstrjoin(const char *a, const char *b)
26 int a_len, b_len;
27 char *joined;
29 a_len = strlen(a);
30 b_len = strlen(b);
31 joined = xnew(char, a_len + b_len + 1);
32 memcpy(joined, a, a_len);
33 memcpy(joined + a_len, b, b_len + 1);
34 return joined;