Skip to content

Commit 3455f42

Browse files
committed
Fix capacitance unit parsing
Fix the liberty parser to handle "capacitive_load_unit (1,fF)". Previously this input would produce a corrupted internal representation for the library as there would be an extra value written on line 944.
1 parent 279217b commit 3455f42

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/map/scl/sclLiberty.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -941,11 +941,16 @@ void Scl_LibertyReadLoadUnit( Scl_Tree_t * p, Vec_Str_t * vOut )
941941
char * pHead = Scl_LibertyReadString(p, pItem->Head);
942942
float First = atof(strtok(pHead, " \t\n\r\\\","));
943943
char * pSecond = strtok(NULL, " \t\n\r\\\",");
944-
Vec_StrPutF_( vOut, First );
945-
if ( pSecond && !strcmp(pSecond, "pf") )
944+
if ( pSecond && (!strcmp(pSecond, "pf") || !strcmp(pSecond, "pF")) )
945+
{
946+
Vec_StrPutF_( vOut, First );
946947
Vec_StrPutI_( vOut, 12 );
947-
else if ( pSecond && !strcmp(pSecond, "ff") )
948+
}
949+
else if ( pSecond && (!strcmp(pSecond, "ff") || !strcmp(pSecond, "fF")) )
950+
{
951+
Vec_StrPutF_( vOut, First );
948952
Vec_StrPutI_( vOut, 15 );
953+
}
949954
else break;
950955
return;
951956
}

0 commit comments

Comments
 (0)