summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2015-12-11 08:09:30 +0100
committerBardur Arantsson <bardur@scientician.net>2015-12-11 08:09:30 +0100
commit5ce1ccafa65c5cfbcd0f4431f51abfa1d700a885 (patch)
treea788b50131527a2464b52a47f346023fa64071bf /src
parent97bcf1bc612d9920390c885b8dcea0b0cda6f246 (diff)
Remove strfmt()
Diffstat (limited to 'src')
-rw-r--r--src/cmd1.cc4
-rw-r--r--src/melee2.cc2
-rw-r--r--src/z-form.c24
-rw-r--r--src/z-form.h3
4 files changed, 3 insertions, 30 deletions
diff --git a/src/cmd1.cc b/src/cmd1.cc
index dbb888c7..f4066915 100644
--- a/src/cmd1.cc
+++ b/src/cmd1.cc
@@ -1001,7 +1001,7 @@ static void carried_monster_attack(s16b m_idx, bool_ *fear, bool_ *mdeath,
/* Message */
if (act)
{
- strfmt(temp, act, t_name);
+ strnfmt(temp, sizeof(temp), act, t_name);
if (t_ptr->ml)
msg_format("%s %s", sym_name, temp);
@@ -1519,7 +1519,7 @@ static void incarnate_monster_attack(s16b m_idx, bool_ *fear, bool_ *mdeath,
/* Message */
if (act)
{
- strfmt(temp, act, t_name);
+ strnfmt(temp, sizeof(temp), act, t_name);
if (t_ptr->ml)
msg_format("You %s", temp);
diff --git a/src/melee2.cc b/src/melee2.cc
index ce2f11a2..b3aa5c61 100644
--- a/src/melee2.cc
+++ b/src/melee2.cc
@@ -5673,7 +5673,7 @@ static bool_ monst_attack_monst(int m_idx, int t_idx)
/* Message */
if (act)
{
- strfmt(temp, act, t_name);
+ strnfmt(temp, sizeof(temp), act, t_name);
if (m_ptr->ml || t_ptr->ml)
monster_msg("%^s %s", m_name, temp);
diff --git a/src/z-form.c b/src/z-form.c
index b9a78fca..90d71294 100644
--- a/src/z-form.c
+++ b/src/z-form.c
@@ -627,30 +627,6 @@ uint strnfmt(char *buf, uint max, cptr fmt, ...)
}
-/*
- * Do a vstrnfmt (see above) into a buffer of unknown size.
- * Since the buffer size is unknown, the user better verify the args.
- */
-uint strfmt(char *buf, cptr fmt, ...)
-{
- uint len;
-
- va_list vp;
-
- /* Begin the Varargs Stuff */
- va_start(vp, fmt);
-
- /* Build the string, assume 32K buffer */
- len = vstrnfmt(buf, 32767, fmt, vp);
-
- /* End the Varargs Stuff */
- va_end(vp);
-
- /* Return the number of bytes written */
- return (len);
-}
-
-
/*
diff --git a/src/z-form.h b/src/z-form.h
index 61702432..ac49c658 100644
--- a/src/z-form.h
+++ b/src/z-form.h
@@ -26,9 +26,6 @@ extern uint vstrnfmt(char *buf, uint max, cptr fmt, va_list vp);
/* Simple interface to "vstrnfmt()" */
extern uint strnfmt(char *buf, uint max, cptr fmt, ...);
-/* Simple interface to "vstrnfmt()", assuming infinite length */
-extern uint strfmt(char *buf, cptr fmt, ...);
-
/* Simple interface to "vformat()" */
extern char *format(cptr fmt, ...);