From 3455f423d09ac35345468a15ff5934ea69c84760 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Povi=C5=A1er?= Date: Tue, 26 Aug 2025 11:49:14 +0200 Subject: [PATCH] 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. --- src/map/scl/sclLiberty.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/map/scl/sclLiberty.c b/src/map/scl/sclLiberty.c index 461fa56ef..2064fde69 100644 --- a/src/map/scl/sclLiberty.c +++ b/src/map/scl/sclLiberty.c @@ -941,11 +941,16 @@ void Scl_LibertyReadLoadUnit( Scl_Tree_t * p, Vec_Str_t * vOut ) char * pHead = Scl_LibertyReadString(p, pItem->Head); float First = atof(strtok(pHead, " \t\n\r\\\",")); char * pSecond = strtok(NULL, " \t\n\r\\\","); - Vec_StrPutF_( vOut, First ); - if ( pSecond && !strcmp(pSecond, "pf") ) + if ( pSecond && (!strcmp(pSecond, "pf") || !strcmp(pSecond, "pF")) ) + { + Vec_StrPutF_( vOut, First ); Vec_StrPutI_( vOut, 12 ); - else if ( pSecond && !strcmp(pSecond, "ff") ) + } + else if ( pSecond && (!strcmp(pSecond, "ff") || !strcmp(pSecond, "fF")) ) + { + Vec_StrPutF_( vOut, First ); Vec_StrPutI_( vOut, 15 ); + } else break; return; }