src/thirdparty/binreloc/binreloc.c
char *
br_strcat (const char *str1, const char *str2)
{
	char *result;
	size_t len1, len2;

	if (str1 == NULL)
		str1 = "";
	if (str2 == NULL)
		str2 = "";

	len1 = strlen (str1);
	len2 = strlen (str2);

	result = (char *) malloc (len1 + len2 + 1);
	memcpy (result, str1, len1);
	memcpy (result + len1, str2, len2);
	result[len1 + len2] = '\0';

	return result;
}
/** Concatenate str1 and str2 to a newly allocated string.
 *
 * @param str1 A string.
 * @param str2 Another string.
 * @returns A newly-allocated string. This string should be freed when no longer needed.
 */
Concatenate str1 and str2 to a newly allocated string.
@param str1 A string.
@param str2 Another string.
@returns A newly-allocated string. This string should be freed when no longer needed.
Concatenate str1 and str2 to a newly allocated string . @param str1 A string . @param str2 Another string . @returns A newly - allocated string . This string should be freed when no longer needed .
char *
br_strcat (const char *str1, const char *str2)
{
	char *result;
	size_t len1, len2;
	if (str1 == NULL)
		str1 = "";
	if (str2 == NULL)
		str2 = "";
	len1 = strlen (str1);
	len2 = strlen (str2);
	result = (char *) malloc (len1 + len2 + 1);
	memcpy (result, str1, len1);
	memcpy (result + len1, str2, len2);
	result[len1 + len2] = '\0';
	return result;
}
char * br_strcat ( const char * str1 , const char * str2 ) { char * result ; size_t len1 , len2 ; if ( str1 == NULL ) str1 = " " ; if ( str2 == NULL ) str2 = " " ; len1 = strlen ( str1 ) ; len2 = strlen ( str2 ) ; result = ( char * ) malloc ( len1 + len2 + 1 ) ; memcpy ( result , str1 , len1 ) ; memcpy ( result + len1 , str2 , len2 ) ; result [ len1 + len2 ] = ' \0 ' ; return result ; }
Concatenate str1 and str2 to a newly allocated string.
Concatenate str1 and str2 to a newly allocated string .