diff options
author | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2002-09-08 12:05:18 (GMT) |
---|---|---|
committer | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2002-09-08 12:05:18 (GMT) |
commit | 71ae1ba238728561878eaf66dab13facc2a1219d (patch) | |
tree | e3cda5103f5d6b56e7345c3a81ddbf509343f30d | |
parent | d7ffaa659fa8f5b1ae90992e0cc98099b6ed41eb (diff) | |
download | monitoring-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
-rw-r--r-- | plugins/utils.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/plugins/utils.c b/plugins/utils.c index 8bec1cf..d97ad48 100644 --- a/plugins/utils.c +++ b/plugins/utils.c | |||
@@ -404,17 +404,19 @@ strscat (char *dest, const char *src) | |||
404 | { | 404 | { |
405 | size_t len, l2; | 405 | size_t len, l2; |
406 | 406 | ||
407 | if (src) | 407 | if (src == NULL) |
408 | l2 = strlen (src); | ||
409 | else | ||
410 | return dest; | 408 | return dest; |
411 | |||
412 | if (dest) | ||
413 | len = strlen (dest); | ||
414 | else | 409 | else |
410 | l2 = strlen (src); | ||
411 | |||
412 | if (dest == NULL) { | ||
415 | len = 0; | 413 | len = 0; |
414 | dest = malloc (l2 + 1); | ||
415 | } else { | ||
416 | len = strlen (dest); | ||
417 | dest = realloc (dest, len + l2 + 1); | ||
418 | } | ||
416 | 419 | ||
417 | dest = realloc (dest, len + l2 + 1); | ||
418 | if (dest == NULL) | 420 | if (dest == NULL) |
419 | terminate (STATE_UNKNOWN, "failed malloc in strscat\n"); | 421 | terminate (STATE_UNKNOWN, "failed malloc in strscat\n"); |
420 | 422 | ||