Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-07-09 22:34:05 +0400
committerJunio C Hamano <gitster@pobox.com>2014-07-09 22:34:05 +0400
commit3b8e8af187cb86ed030432f1a067121fdd4b1c3b (patch)
treedd8cdaa18cfd70d6cfe6b0a3120fccb5f0a971cd /strbuf.h
parente91ae32a01ffe294b8510c1d8cd7138493a0712f (diff)
parentcb6c38d5cce7d8d48a57346b332a68cea1489df1 (diff)
Merge branch 'jk/xstrfmt'
* jk/xstrfmt: setup_git_env(): introduce git_path_from_env() helper unique_path: fix unlikely heap overflow walker_fetch: fix minor memory leak merge: use argv_array when spawning merge strategy sequencer: use argv_array_pushf setup_git_env: use git_pathdup instead of xmalloc + sprintf use xstrfmt to replace xmalloc + strcpy/strcat use xstrfmt to replace xmalloc + sprintf use xstrdup instead of xmalloc + strcpy use xstrfmt in favor of manual size calculations strbuf: add xstrfmt helper
Diffstat (limited to 'strbuf.h')
-rw-r--r--strbuf.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/strbuf.h b/strbuf.h
index e9ad03eabe..a594c24b2b 100644
--- a/strbuf.h
+++ b/strbuf.h
@@ -187,4 +187,13 @@ extern int fprintf_ln(FILE *fp, const char *fmt, ...);
char *xstrdup_tolower(const char *);
+/*
+ * Create a newly allocated string using printf format. You can do this easily
+ * with a strbuf, but this provides a shortcut to save a few lines.
+ */
+__attribute__((format (printf, 1, 0)))
+char *xstrvfmt(const char *fmt, va_list ap);
+__attribute__((format (printf, 1, 2)))
+char *xstrfmt(const char *fmt, ...);
+
#endif /* STRBUF_H */