Commit 21c65e8f authored by Rémy Oudompheng's avatar Rémy Oudompheng

cgo: accept null pointers in gccgo flavour of C.GoString.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5569074
parent 75397e65
......@@ -786,7 +786,8 @@ const char *CString(struct __go_string s) {
}
struct __go_string GoString(char *p) {
return __go_byte_array_to_string(p, strlen(p));
int len = (p != NULL) ? strlen(p) : 0;
return __go_byte_array_to_string(p, len);
}
struct __go_string GoStringN(char *p, int n) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment