summaryrefslogtreecommitdiffstats
path: root/plugins/utils.c
diff options
context:
space:
mode:
authorKarl DeBisschop <kdebisschop@users.sourceforge.net>2003-08-07 11:51:12 (GMT)
committerKarl DeBisschop <kdebisschop@users.sourceforge.net>2003-08-07 11:51:12 (GMT)
commit9e17dab6c3e4b4e7142f3ea5b2a60fcd488dc709 (patch)
treecb5831f4c018edc441686b2fe7715eb91de4ffee /plugins/utils.c
parent7f1bb2a782a008b55b0ef657ec01d7fbdb637fd4 (diff)
downloadmonitoring-plugins-9e17dab6c3e4b4e7142f3ea5b2a60fcd488dc709.tar.gz
replace "terminate" with "die" for shorter name and better readability
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@656 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/utils.c')
-rw-r--r--plugins/utils.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/plugins/utils.c b/plugins/utils.c
index 5f770a1..959541b 100644
--- a/plugins/utils.c
+++ b/plugins/utils.c
@@ -132,17 +132,6 @@ void
132die (int result, const char *fmt, ...) 132die (int result, const char *fmt, ...)
133{ 133{
134 va_list ap; 134 va_list ap;
135 printf ("%s %s: ", sizeof (char) + index(progname, '_'), state_text(result));
136 va_start (ap, fmt);
137 vprintf (fmt, ap);
138 va_end (ap);
139 exit (result);
140}
141
142void
143terminate (int result, const char *fmt, ...)
144{
145 va_list ap;
146 va_start (ap, fmt); 135 va_start (ap, fmt);
147 vprintf (fmt, ap); 136 vprintf (fmt, ap);
148 va_end (ap); 137 va_end (ap);
@@ -482,7 +471,7 @@ strpcpy (char *dest, const char *src, const char *str)
482 if (dest == NULL || strlen (dest) < len) 471 if (dest == NULL || strlen (dest) < len)
483 dest = realloc (dest, len + 1); 472 dest = realloc (dest, len + 1);
484 if (dest == NULL) 473 if (dest == NULL)
485 terminate (STATE_UNKNOWN, "failed realloc in strpcpy\n"); 474 die (STATE_UNKNOWN, "failed realloc in strpcpy\n");
486 475
487 strncpy (dest, src, len); 476 strncpy (dest, src, len);
488 dest[len] = '\0'; 477 dest[len] = '\0';
@@ -526,7 +515,7 @@ strpcat (char *dest, const char *src, const char *str)
526 515
527 dest = realloc (dest, len + l2 + 1); 516 dest = realloc (dest, len + l2 + 1);
528 if (dest == NULL) 517 if (dest == NULL)
529 terminate (STATE_UNKNOWN, "failed malloc in strscat\n"); 518 die (STATE_UNKNOWN, "failed malloc in strscat\n");
530 519
531 strncpy (dest + len, src, l2); 520 strncpy (dest + len, src, l2);
532 dest[len + l2] = '\0'; 521 dest[len + l2] = '\0';