summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d7ffaa6)
raw | patch | inline | side by side (parent: d7ffaa6)
author | Karl DeBisschop <kdebisschop@users.sourceforge.net> | |
Sun, 8 Sep 2002 12:05:18 +0000 (12:05 +0000) | ||
committer | Karl DeBisschop <kdebisschop@users.sourceforge.net> | |
Sun, 8 Sep 2002 12:05:18 +0000 (12:05 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@93 f882894a-f735-0410-b71e-b25c423dba1c
plugins/utils.c | patch | blob | history |
diff --git a/plugins/utils.c b/plugins/utils.c
index 8bec1cf12c2d811edfbbcbee42e67334956f535c..d97ad48080d51f69bdf4497456e00147081078b3 100644 (file)
--- a/plugins/utils.c
+++ b/plugins/utils.c
{
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");