aboutsummaryrefslogtreecommitdiff
path: root/plugins/utils.c
diff options
context:
space:
mode:
authorGravatar Karl DeBisschop <kdebisschop@users.sourceforge.net> 2002-09-08 12:05:18 +0000
committerGravatar Karl DeBisschop <kdebisschop@users.sourceforge.net> 2002-09-08 12:05:18 +0000
commit71ae1ba238728561878eaf66dab13facc2a1219d (patch)
treee3cda5103f5d6b56e7345c3a81ddbf509343f30d /plugins/utils.c
parentd7ffaa659fa8f5b1ae90992e0cc98099b6ed41eb (diff)
downloadmonitoring-plugins-71ae1ba238728561878eaf66dab13facc2a1219d.tar.gz
clears up warnings in splint
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@93 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/utils.c')
-rw-r--r--plugins/utils.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/plugins/utils.c b/plugins/utils.c
index 8bec1cf1..d97ad480 100644
--- a/plugins/utils.c
+++ b/plugins/utils.c
@@ -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
+ 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");