Skip to content
Snippets Groups Projects
Commit 5587276b authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

table::decodeForm1: missing longname results in Abort trap (bug fix)

parent c922275c
No related branches found
No related tags found
No related merge requests found
2014-11-20 Uwe Schulzweida
* table::decodeForm1: missing longname results in Abort trap (bug fix)
2014-11-14 Uwe Schulzweida
* cdfCopyRecord: removed limit for datasize
......
......@@ -205,16 +205,21 @@ decodeForm1(char *pline, char *name, char *longname, char *units)
while ( isspace((int) *pline) ) pline++;
len = strlen(pline);
if ( len > 0)
if ( len > 0 )
{
pstart = pline;
pend = strrchr(pline, '[');
if ( pend )
pend--;
if ( pend == pstart )
len = 0;
else
pend = pstart + len;
while ( isspace((int) *pend) ) pend--;
len = (size_t)(pend - pstart + 1);
{
if ( pend )
pend--;
else
pend = pstart + len;
while ( isspace((int) *pend) ) pend--;
len = (size_t)(pend - pstart + 1);
}
if ( len > 0 )
{
memcpy(longname, pstart, len);
......@@ -234,10 +239,10 @@ decodeForm1(char *pline, char *name, char *longname, char *units)
{
memcpy(units, pstart, len);
units[len] = 0;
}
}
}
}
return (0);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment