summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 26af21d)
raw | patch | inline | side by side (parent: 26af21d)
author | Karl DeBisschop <kdebisschop@users.sourceforge.net> | |
Wed, 16 Oct 2002 10:14:14 +0000 (10:14 +0000) | ||
committer | Karl DeBisschop <kdebisschop@users.sourceforge.net> | |
Wed, 16 Oct 2002 10:14:14 +0000 (10:14 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@118 f882894a-f735-0410-b71e-b25c423dba1c
plugins/utils.c | patch | blob | history |
diff --git a/plugins/utils.c b/plugins/utils.c
index 6e52dab75e0759c501910d30ba3a16452acad595..05d3f7975105f667b04829477e98e521b03da53d 100644 (file)
--- a/plugins/utils.c
+++ b/plugins/utils.c
char *
strscat (char *dest, const char *src)
{
- 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");
-
- strncpy (dest + len, src, l2);
- dest[len + l2] = '\0';
+ if (src != NULL)
+ asprintf (&dest, "%s%s", dest, src);
return dest;
}