This makes TrimSpaces() trim tab characters off the end of the string also (not just the beginning). Also updates loop to prevent buffer underrun.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15009
6f19259b-4bc3-4df7-8a09-
765794883524
}\r
\r
//\r
- // Remove any spaces at the end of the (*String).\r
+ // Remove any spaces and tabs at the end of the (*String).\r
//\r
- while ((*String)[StrLen((*String))-1] == L' ') {\r
+ while ((StrLen (*String) > 0) && (((*String)[StrLen((*String))-1] == L' ') || ((*String)[StrLen((*String))-1] == L'\t'))) {\r
(*String)[StrLen((*String))-1] = CHAR_NULL;\r
}\r
\r