mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-06-03 13:59:53 -04:00
clears up warnings in splint
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@93 f882894a-f735-0410-b71e-b25c423dba1c
This commit is contained in:
parent
d7ffaa659f
commit
71ae1ba238
1 changed files with 10 additions and 8 deletions
|
|
@ -404,17 +404,19 @@ strscat (char *dest, const char *src)
|
|||
{
|
||||
size_t len, l2;
|
||||
|
||||
if (src)
|
||||
l2 = strlen (src);
|
||||
else
|
||||
if (src == NULL)
|
||||
return dest;
|
||||
|
||||
if (dest)
|
||||
len = strlen (dest);
|
||||
else
|
||||
len = 0;
|
||||
l2 = strlen (src);
|
||||
|
||||
if (dest == NULL) {
|
||||
len = 0;
|
||||
dest = malloc (l2 + 1);
|
||||
} else {
|
||||
len = strlen (dest);
|
||||
dest = realloc (dest, len + l2 + 1);
|
||||
}
|
||||
|
||||
dest = realloc (dest, len + l2 + 1);
|
||||
if (dest == NULL)
|
||||
terminate (STATE_UNKNOWN, "failed malloc in strscat\n");
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue