[Go] Fix "in" typemap for char *&.

This commit is contained in:
Ian Lance Taylor 2016-04-17 22:20:28 -07:00
commit 9cd3e28c4e

View file

@ -441,11 +441,12 @@
$1[$input.n] = '\0'; $1[$input.n] = '\0';
%} %}
%typemap(in) char *& %typemap(in) char *& (char *temp)
%{ %{
$1 = ($1_ltype)malloc($input.n + 1); temp = (char *)malloc($input.n + 1);
memcpy($1, $input.p, $input.n); memcpy(temp, $input.p, $input.n);
$1[$input.n] = '\0'; temp[$input.n] = '\0';
$1 = ($1_ltype)&temp;
%} %}
%typemap(freearg) %typemap(freearg)