[Olsr-cvs] olsrd-current/src/unix ifnet.c,1.49,1.50

Bernd Petrovitsch (spam-protected)
Thu Aug 23 23:04:35 CEST 2007


Update of /cvsroot/olsrd/olsrd-current/src/unix
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30706/src/unix

Modified Files:
	ifnet.c 
Log Message:
* made s local function static
* avoid a name clash of a local variable with an library function


Index: ifnet.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/unix/ifnet.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -C2 -d -r1.49 -r1.50
*** ifnet.c	13 May 2007 22:23:55 -0000	1.49
--- ifnet.c	23 Aug 2007 21:04:33 -0000	1.50
***************
*** 705,717 ****
  }
  
! static char basename[32];
! char* if_basename(char* name);
! char* if_basename(char* name)
  {
  	char *p = strchr(name, ':');
! 	if (0 == p || p - name >= (int)(sizeof(basename) / sizeof(basename[0]) - 1)) return name;
! 	memcpy(basename, name, p - name);
! 	basename[p - name] = 0;
! 	return basename;
  }
  
--- 705,719 ----
  }
  
! static char basenamestr[32];
! static char* if_basename(const char* name);
! static char* if_basename(const char* name)
  {
  	char *p = strchr(name, ':');
! 	if (NULL == p || p - name >= (int)(sizeof(basenamestr) / sizeof(basenamestr[0]) - 1)) {
!         	return name;
!         }
! 	memcpy(basenamestr, name, p - name);
! 	basenamestr[p - name] = 0;
! 	return basenamestr;
  }
  





More information about the Olsr-cvs mailing list