[Nagiosplug-checkins] CVS: nagiosplug/plugins utils.c,1.2,1.3

Karl DeBisschop kdebisschop at users.sourceforge.net
Sun Sep 8 05:06:02 CEST 2002


Update of /cvsroot/nagiosplug/nagiosplug/plugins
In directory usw-pr-cvs1:/tmp/cvs-serv5038/plugins

Modified Files:
	utils.c 
Log Message:
clears up warnings in splint

Index: utils.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/utils.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** utils.c	19 Jun 2002 05:11:52 -0000	1.2
--- utils.c	8 Sep 2002 12:05:18 -0000	1.3
***************
*** 405,419 ****
  	size_t len, l2;
  
! 	if (src)
! 		l2 = strlen (src);
! 	else
  		return dest;
- 
- 	if (dest)
- 		len = strlen (dest);
  	else
  		len = 0;
  
- 	dest = realloc (dest, len + l2 + 1);
  	if (dest == NULL)
  		terminate (STATE_UNKNOWN, "failed malloc in strscat\n");
--- 405,421 ----
  	size_t len, l2;
  
! 	if (src == NULL)
  		return dest;
  	else
+ 		l2 = strlen (src);
+ 
+ 	if (dest == NULL) {
  		len = 0;
+ 		dest = malloc (l2 + 1);
+ 	} else {
+ 		len = strlen (dest);
+ 		dest = realloc (dest, len + l2 + 1);
+ 	}
  
  	if (dest == NULL)
  		terminate (STATE_UNKNOWN, "failed malloc in strscat\n");





More information about the Commits mailing list