Commit 619aca16 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

institutInq: check contents of name and longname (bug fix)

parent e54c999f
2013-04-25 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* institutInq: check contents of name and longname (bug fix) [Bug #3419]
2013-04-23 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* cfortran.h::kill_trailing: wrong result with gcc -O3, use prama for -O2 (bug fix) [report: Luis Kornblueh]
......
......@@ -198,8 +198,12 @@ int institutInq(int center, int subcenter, const char *name, const char *longnam
ip1->used = 0;
ip1->center = center;
ip1->subcenter = subcenter;
ip1->name = ( char * ) name;
ip1->longname = ( char * ) longname;
ip1->name = NULL;
ip1->longname = NULL;
if ( name && *name )
ip1->name = ( char * ) name;
if ( longname && *longname )
ip1->longname = ( char * ) longname;
instCount = instituteCount ();
instResHs = xmalloc ( instCount * sizeof ( int ));
......@@ -234,8 +238,8 @@ int institutDef(int center, int subcenter, const char *name, const char *longnam
instituteptr->center = center;
instituteptr->subcenter = subcenter;
if ( name ) instituteptr->name = strdupx(name);
if ( longname ) instituteptr->longname = strdupx(longname);
if ( name && *name ) instituteptr->name = strdupx(name);
if ( longname && *longname ) instituteptr->longname = strdupx(longname);
return instituteptr->self;
}
......
......@@ -172,7 +172,7 @@ int modelInq(int instID, int modelgribID, char *name)
if ( modelptr->used )
{
if ( name )
if ( name && *name )
{
found = 1;
if ( instID != -1 && modelptr->instID != instID ) found = 0;
......@@ -215,7 +215,7 @@ int modelDef(int instID, int modelgribID, const char *name)
modelptr->instID = instID;
modelptr->modelgribID = modelgribID;
if ( name ) modelptr->name = strdupx(name);
if ( name && *name ) modelptr->name = strdupx(name);
return modelptr->self;
}
......
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