Commit 5587276b authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

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

parent c922275c
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 == pstart )
len = 0;
else
{
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);
......
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