bridge/class-master/depend/pari/src/basemath/concat.c
/* assume A or B is a t_STR */
assume A or B is a t_STR
assume A or B is a t_STR
static GEN
strconcat(GEN x, GEN y)
{
  size_t l, lx;
  char *sx = GENtostr_unquoted(x);
  char *sy = GENtostr_unquoted(y), *str;
  lx = strlen(sx);
  l = nchar2nlong(lx + strlen(sy) + 1);
  x = cgetg(l + 1, t_STR); str = GSTR(x);
  strcpy(str,   sx);
  strcpy(str+lx,sy); return x;
}
static GEN strconcat ( GEN x , GEN y ) { size_t l , lx ; char * sx = GENtostr_unquoted ( x ) ; char * sy = GENtostr_unquoted ( y ) , * str ; lx = strlen ( sx ) ; l = nchar2nlong ( lx + strlen ( sy ) + 1 ) ; x = cgetg ( l + 1 , t_STR ) ; str = GSTR ( x ) ; strcpy ( str , sx ) ; strcpy ( str + lx , sy ) ; return x ; }
assume A or B is a t_STR
assume A or B is a t_STR