From 585e2f7d6c971afb50fb06bbaf6341f371297b10 Mon Sep 17 00:00:00 2001 From: "W. Eric Norum" Date: Tue, 3 Feb 2004 16:49:33 +0000 Subject: [PATCH] Stupid vxWorks implementation of toupper/tolower expands macro argument more than once! --- src/libCom/misc/epicsString.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/libCom/misc/epicsString.c b/src/libCom/misc/epicsString.c index d47ea8b26..4f8b8bd6b 100644 --- a/src/libCom/misc/epicsString.c +++ b/src/libCom/misc/epicsString.c @@ -93,12 +93,15 @@ epicsShareFunc int epicsShareAPI epicsStrCaseCmp( int nexts1,nexts2; while(1) { - nexts1 = toupper(*s1++); - nexts2 = toupper(*s2++); + /* vxWorks implementation expands argument more than once!!! */ + nexts1 = toupper(*s1); + nexts2 = toupper(*s2); if(nexts1==0) return( (nexts2==0) ? 0 : 1 ); if(nexts2==0) return(-1); if(nexts1nexts2) return(1); + s1++; + s2++; } return(0); } @@ -111,12 +114,15 @@ epicsShareFunc int epicsShareAPI epicsStrnCaseCmp( while(1) { if(ind++ >= n) break; - nexts1 = toupper(*s1++); - nexts2 = toupper(*s2++); + /* vxWorks implementation expands argument more than once!!! */ + nexts1 = toupper(*s1); + nexts2 = toupper(*s2); if(nexts1==0) return( (nexts2==0) ? 0 : 1 ); if(nexts2==0) return(-1); if(nexts1nexts2) return(1); + s1++; + s2++; } return(0); }