fix use vasprintf
This commit is contained in:
parent
5e23c20364
commit
36280b0320
@ -348,13 +348,14 @@ CServiceClientPlugin::GenerateSourceConnectFunctionDefinition(Service::Ptr servi
|
||||
ss << " assert(format != NULL);" << std::endl;
|
||||
ss << std::endl;
|
||||
ss << " int32_t status = 0;" << std::endl;
|
||||
ss << " char address[1024];" << std::endl;
|
||||
ss << " char *address = NULL;" << std::endl;
|
||||
ss << " va_list args;" << std::endl;
|
||||
ss << " va_start(args, format);" << std::endl;
|
||||
ss << " vsnprintf(address, sizeof(address), format, args);" << std::endl;
|
||||
ss << " vasprintf(&address, format, args); " << std::endl;
|
||||
ss << " va_end(args);" << std::endl;
|
||||
ss << std::endl;
|
||||
ss << " status = Client_Connect(client->impl, address);" << std::endl;
|
||||
ss << " free(address); " << std::endl;
|
||||
ss << " if (status != 0) { return status; }" << std::endl;
|
||||
ss << std::endl;
|
||||
ss << " Client_SetCallback(client->impl, " << service->id() << "_Client_Dispatch, client);" << std::endl;
|
||||
|
Loading…
x
Reference in New Issue
Block a user