Commit 34649368 authored by Oliver Heidmann's avatar Oliver Heidmann
Browse files

removed usage of old operator argv access functions

parent 01cf0e4f
......@@ -24,9 +24,9 @@
#include <cdi.h>
#include "process_int.h"
#include "readline.h"
#include <string.h>
void *
Setgatt(void *process)
......@@ -34,7 +34,7 @@ Setgatt(void *process)
int nrecs;
int varID, levelID;
size_t nmiss;
char *attname = nullptr, *attstring = nullptr, *attfile = nullptr;
char *attname = nullptr, *attstring = nullptr, *attfile = nullptr; //TODO to std::string(all three)
cdoInitialize(process);
......@@ -46,12 +46,12 @@ Setgatt(void *process)
if (operatorID == SETGATT)
{
operatorInputArg(cdoOperatorEnter(operatorID));
attname = operatorArgv()[0];
attstring = operatorArgv()[1];
strcpy(attname, cdoOperatorArgv(0).c_str()); //TODO replace attname through std::string
strcpy(attstring, cdoOperatorArgv(1).c_str()); //TODO replace attstring through std::string
}
else
{
attfile = operatorArgv()[0];
strcpy(attfile, cdoOperatorArgv(0).c_str()); //TODO replace attfile trhough std::string
}
const auto streamID1 = cdoOpenRead(0);
......@@ -128,7 +128,9 @@ Setgatt(void *process)
tsID++;
}
if (attname != nullptr) free(attname);
if (attstring != nullptr) free(attstring);
if (attfile != nullptr) free(attfile);
cdoStreamClose(streamID1);
cdoStreamClose(streamID2);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment