mirror of
https://github.com/golang/go
synced 2024-11-22 10:54:46 -07:00
cgo: accept null pointers in gccgo flavour of C.GoString.
R=golang-dev, rsc CC=golang-dev https://golang.org/cl/5569074
This commit is contained in:
parent
75397e65ee
commit
21c65e8f33
@ -786,7 +786,8 @@ const char *CString(struct __go_string s) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct __go_string GoString(char *p) {
|
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) {
|
struct __go_string GoStringN(char *p, int n) {
|
||||||
|
Loading…
Reference in New Issue
Block a user