Re: [PATCH 3/4] Pull refs by HTTP
- From
- Edgar Toernig <froese@gmx.de>
- Date
- May 13, 2005, 11:15 UTC
- Message-ID
- <20050513131531.4317677b.froese@gmx.de>
- In-Reply-To
- <Pine.LNX.4.21.0505130256150.30848-100000@iabervon.org>
Daniel Barkalow wrote:
Show 10 quoted lines
> > + url = xmalloc(strlen(base) + 7 + strlen(dir) + strlen(name)); > + strcpy(url, base); > + posn = url + strlen(base); > + strcpy(posn, "refs/"); > + posn += 5; > + strcpy(posn, dir); > + posn += strlen(dir); > + *(posn++) = '/'; > + strcpy(posn, name);
Have you ever heard of sprintf & co?
sprintf(url, "%srefs/%s/%s", base, dir, name);
Ciao, ET.