Browse Source

Gmt module: Fix bad assignment to uninitialised pointer in previous commit.

master
Michael Uleysky 8 years ago
parent
commit
6c6b52f5b2
  1. 4
      modules/gmt/modgmt_gsfuncs.cpp
  2. 4
      modules/gmt/modgmt_internals.cpp

4
modules/gmt/modgmt_gsfuncs.cpp

@ -82,6 +82,7 @@ static int GhostRun(const std::string& opts, struct gs_runtime* r, std::string*
{
struct gsworkthreadpars wp;
int* pret;
int ret=0;
wp.r=r;
wp.input_callback=input;
@ -96,7 +97,7 @@ static int GhostRun(const std::string& opts, struct gs_runtime* r, std::string*
ssize_t br;
char buffer[4096];
if(0!=pipe(pipefd)) {*pret=-1; goto end;}
if(0!=pipe(pipefd)) {ret=-1; goto end;}
wp.fd=pipefd[1];
out->erase();
@ -113,6 +114,7 @@ static int GhostRun(const std::string& opts, struct gs_runtime* r, std::string*
else pret=reinterpret_cast<int*>(gsworkthread(&wp));
end:
if(0!=ret) return ret;
return *pret;
}

4
modules/gmt/modgmt_internals.cpp

@ -44,8 +44,9 @@ int callgmtmodule(void *api, const char *module, struct GMT_OPTION *opts, std::s
pthread_t wthr;
struct gmtworkthreadpars p;
int *pret;
int ret=0;
if(0!=pipe(pipefd)) {*pret=-1; goto end;}
if(0!=pipe(pipefd)) {ret=-1; goto end;}
p.api=api;
p.module=module;
p.opts=opts;
@ -60,6 +61,7 @@ int callgmtmodule(void *api, const char *module, struct GMT_OPTION *opts, std::s
pthread_join(wthr,reinterpret_cast<void**>(&pret));
end:
if(0!=ret) return ret;
return *pret;
}
// Overloaded variant with opts as std::string

Loading…
Cancel
Save