--- iometer/src/IOCommon.h	Sun Mar  2 13:31:50 2003
+++ /home/xca1019/IOCommon.h	Sun Mar  2 13:27:22 2003
@@ -11,10 +11,15 @@
 /* ##                                                                     ## */
 /* ##  Remarks ...: - All Defines, Includes etc. should be moved to this  ## */
 /* ##                 file to cleanup the code.                           ## */
+/* ##               - Functions like Strip() should be moved to a new     ## */
+/* ##                 code file named IOCommon.cpp                        ## */
 /* ##                                                                     ## */
 /* ## ------------------------------------------------------------------- ## */
 /* ##                                                                     ## */
-/* ##  Changes ...: 2003-02-26 (joe@eiler.net)                            ## */
+/* ##  Changes ...: 2003-03-02 (daniel.scheibli@edelbyte.org)             ## */
+/* ##               - Added the implementation of the Strip() function    ## */
+/* ##                 which removes leading and trailing blanks.          ## */
+/* ##               2003-02-26 (joe@eiler.net)                            ## */
 /* ##               - Added MAX_EXCLUDE_FILESYS so excluded filesystem    ## */
 /* ##                 types are no longer hard coded.                     ## */
 /* ##               2003-02-15 (daniel.scheibli@edelbyte.org)             ## */
@@ -589,6 +594,31 @@
 #endif // BIG_ENDIAN_ARCH
 
 #endif // UNIX
+
+
+
+extern inline char *Strip( char *pcString )
+{
+ unsigned int uiLength = strlen(pcString);
+ int          I;
+ int          iIndex = 0;
+ int          iPos1, iPos2; 
+ 
+ for( iPos1 = 0;            ( (iPos1<(int)uiLength) && (pcString[iPos1]==(int)' ') ); iPos1++ ) { /* NOP */ }
+ for( iPos2 = uiLength - 1; ( (iPos2>=0)            && (pcString[iPos2]==(int)' ') ); iPos2-- ) { /* NOP */ }
+ 
+ if( (iPos1 != 0) || (iPos2 != ((int)uiLength - 1)) )
+ {    
+  for( I = iPos1; I <= iPos2; I++ )
+  {
+   pcString[iIndex] = pcString[I];
+   iIndex++;
+  }
+  pcString[iIndex] = '\0';
+ }
+ 
+ return(pcString);
+}
 
 
 
--- iometer/src/IOPerformanceLinux.cpp	Sun Mar  2 13:31:58 2003
+++ /home/xca1019/IOPerformanceLinux.cpp	Sun Mar  2 13:27:29 2003
@@ -18,7 +18,11 @@
 /* ##                                                                     ## */
 /* ## ------------------------------------------------------------------- ## */
 /* ##                                                                     ## */
-/* ##  Changes ...: 2003-02-26 (joe@eiler.net)                            ## */
+/* ##  Changes ...: 2003-03-02 (daniel.scheibli@edelbyte.org)             ## */
+/* ##               - Bugfix for Get_NI_Counters to ensure, that          ## */
+/* ##                 interface names with no leading blanks (for         ## */
+/* ##                 example dummy0) are handled as well.                ## */
+/* ##               2003-02-26 (joe@eiler.net)                            ## */
 /* ##               - Added some more GHz processor stuff.                ## */
 /* ##               - Changed Get_NI_Counters so interfaces that do not   ## */
 /* ##                 contain statistics in /proc/net/dev do not cause    ## */
@@ -791,9 +795,9 @@
 	for (network_interfaces = 0;
 			 network_interfaces < MAX_NUM_INTERFACES;
 			 ++network_interfaces) {
-		// Take out the leading white space.
-		// then grab the interface name
-		scanCount = fscanf(netInfo, "%*[ ] %[^:]: %*d %d %lld %*d %*d %*d %*d %d %lld",ifname,
+		// grab the interface names (if there are leading blanks,
+		// then they are removed using the Strip() function)
+		scanCount = fscanf(netInfo, "%[^:]: %*d %d %lld %*d %*d %*d %*d %d %lld",ifname,
 											 &packetIn,
 											 &raw_ni_data[network_interfaces]
 											             [NI_IN_ERRORS][snapshot],
@@ -804,6 +808,7 @@
 			fclose(netInfo);
 			return;
 		}
+		Strip(ifname);
 		if(strstr(NET_IF_TO_IGNORE,ifname) != NULL) {
 			#ifdef _DEBUG
 				cout << "Ignoring network interface: " << ifname << endl;
