summaryrefslogtreecommitdiffstats
path: root/plugins/utils.c
diff options
context:
space:
mode:
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 5f770a1f..959541bf 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';