summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bootstrap.conf1
-rw-r--r--src/util.c5
2 files changed, 3 insertions, 3 deletions
diff --git a/bootstrap.conf b/bootstrap.conf
index 3954c4d..81b318e 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -81,6 +81,7 @@ xalloc
xfreopen
xreadlink
xstrtoumax
+xvasprintf
'
# Additional xgettext options to use. Use "\\\newline" to break lines.
diff --git a/src/util.c b/src/util.c
index 868b7e8..c02d156 100644
--- a/src/util.c
+++ b/src/util.c
@@ -23,6 +23,7 @@
#include <error.h>
#include <system-quote.h>
#include <xalloc.h>
+#include "xvasprintf.h"
char const pr_program[] = PR_PROGRAM;
@@ -262,14 +263,12 @@ begin_output (void)
names[1] = c_escape (current_name1);
/* Construct the header of this piece of diff. */
- name = xmalloc (strlen (names[0]) + strlen (names[1]) + strlen (switch_string) + 7);
-
/* POSIX 1003.1-2001 specifies this format. But there are some bugs in
the standard: it says that we must print only the last component
of the pathnames, and it requires two spaces after "diff" if
there are no options. These requirements are silly and do not
match historical practice. */
- sprintf (name, "diff%s %s %s", switch_string, names[0], names[1]);
+ name = xasprintf ("diff%s %s %s", switch_string, names[0], names[1]);
if (paginate)
{