summaryrefslogtreecommitdiff
path: root/misc/cgo
diff options
context:
space:
mode:
authorPeter Collingbourne <pcc@google.com>2014-04-26 22:16:38 -0700
committerPeter Collingbourne <pcc@google.com>2014-04-26 22:16:38 -0700
commit19ad7ca20214d25fe390f89ec97a64c2615c1d68 (patch)
treee3eb5940c51c601876cd5d50b2990b48f9d0714e /misc/cgo
parentd9632f8c2df2c70132ba4668e7ed24533589609e (diff)
downloadgo-19ad7ca20214d25fe390f89ec97a64c2615c1d68.tar.gz
cmd/cgo: fix C.CString for strings containing null terminators under gccgo
Previously we used strndup(3) to implement C.CString for gccgo. This is wrong because strndup assumes the string to be null terminated, and stops at the first null terminator. Instead, use malloc and memmove to create a copy of the string, as we do in the gc implementation. LGTM=iant R=iant CC=golang-codereviews https://codereview.appspot.com/96790047 Committer: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'misc/cgo')
0 files changed, 0 insertions, 0 deletions