base64: fix build

$ cat hello_world.v
import base64
println('Hello!')

$ v run hello_world.v
============running hello_world==============================
Hello!
10
vlang-zh.cn
chai-mba:examples chai$ v run hello_world.v
println
println
Generating main()...
/Users/chai//.vlang0.0.12//hello_world.c:3783:22: error: used type 'string' (aka 'struct string') where arithmetic or pointer type is required
 return  (/*casttt*/ (string)( /*77*/ str ) ) ;
                     ^       ~~~~~~~~~~~~~~
1 error generated.
V panic: clang error
pull/417/head
chai2010 2019-06-23 07:57:58 +08:00 committed by Alex Medvednikov
parent 6c6be7acaa
commit 9763167d39
1 changed files with 1 additions and 1 deletions

View File

@ -44,6 +44,6 @@ fn decode(data string) string {
}
}
str[str_len + 1] = `\0`
return string(str)
return tos(str, str_len+2)
}