util/FormatString: return AllocatedString
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
#include "config.h"
|
||||
#include "Client.hxx"
|
||||
#include "util/FormatString.hxx"
|
||||
#include "util/AllocatedString.hxx"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
@@ -45,9 +46,7 @@ client_puts(Client &client, const char *s)
|
||||
void
|
||||
client_vprintf(Client &client, const char *fmt, va_list args)
|
||||
{
|
||||
char *p = FormatNewV(fmt, args);
|
||||
client.Write(p);
|
||||
delete[] p;
|
||||
client.Write(FormatStringV(fmt, args).c_str());
|
||||
}
|
||||
|
||||
void
|
||||
|
@@ -21,6 +21,7 @@
|
||||
#include "Response.hxx"
|
||||
#include "Client.hxx"
|
||||
#include "util/FormatString.hxx"
|
||||
#include "util/AllocatedString.hxx"
|
||||
|
||||
bool
|
||||
Response::Write(const void *data, size_t length)
|
||||
@@ -37,10 +38,7 @@ Response::Write(const char *data)
|
||||
bool
|
||||
Response::FormatV(const char *fmt, va_list args)
|
||||
{
|
||||
char *p = FormatNewV(fmt, args);
|
||||
bool success = Write(p);
|
||||
delete[] p;
|
||||
return success;
|
||||
return Write(FormatStringV(fmt, args).c_str());
|
||||
}
|
||||
|
||||
bool
|
||||
|
Reference in New Issue
Block a user