1
0
mirror of https://github.com/golang/go synced 2024-11-12 08:40:21 -07:00

lib9: fix windows build (don't use runesmprint)

TBR=golang-dev
CC=golang-dev
https://golang.org/cl/7575046
This commit is contained in:
Russ Cox 2013-03-07 14:38:49 -05:00
parent 6ee75663c9
commit 5641a09171

View File

@ -30,18 +30,16 @@ WinRune*
torune(char *p) torune(char *p)
{ {
int i, n; int i, n;
Rune *r1; Rune rr;
WinRune *r; WinRune *r;
r1 = runesmprint("%s", p); n = utflen(p);
n = 0; r = malloc((n+1)*sizeof r[0]);
while(r1[n] != '\0') for(i=0; i<n; i++) {
n++; p += chartorune(&rr, p);
n++; r[i] = rr;
r = malloc(n*sizeof r[0]); }
for(i=0; i<n; i++) r[n] = '\0';
r[i] = r1[i];
free(r1);
return r; return r;
} }