mirror of
https://github.com/anope/anope.git
synced 2026-06-12 15:44:46 +02:00
Abolish the few remaining uses of BUFSIZE.
This commit is contained in:
@@ -41,8 +41,6 @@
|
||||
#include "defs.h"
|
||||
#include "sysconf.h"
|
||||
|
||||
#define BUFSIZE 1024
|
||||
|
||||
#define _(x) x
|
||||
#define N_(x, y) x, y
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
int err = regcomp(&this->regbuf, expr.c_str(), REG_EXTENDED | REG_NOSUB | REG_ICASE);
|
||||
if (err)
|
||||
{
|
||||
char buf[BUFSIZE];
|
||||
char buf[256];
|
||||
regerror(err, &this->regbuf, buf, sizeof(buf));
|
||||
regfree(&this->regbuf);
|
||||
throw RegexException("Error in regex " + expr + ": " + buf);
|
||||
|
||||
@@ -37,7 +37,7 @@ public:
|
||||
int err = regcomp(&this->regbuf, expr.c_str(), REG_EXTENDED | REG_NOSUB);
|
||||
if (err)
|
||||
{
|
||||
char buf[BUFSIZE];
|
||||
char buf[256];
|
||||
regerror(err, &this->regbuf, buf, sizeof(buf));
|
||||
regfree(&this->regbuf);
|
||||
throw RegexException("Error in regex " + expr + ": " + buf);
|
||||
|
||||
@@ -39,7 +39,7 @@ bool StaticFileServer::OnRequest(HTTP::Provider *server, const Anope::string &pa
|
||||
reply.headers["Cache-Control"] = "public";
|
||||
|
||||
int i;
|
||||
char buffer[BUFSIZE];
|
||||
char buffer[1024];
|
||||
while ((i = read(fd, buffer, sizeof(buffer))) > 0)
|
||||
reply.Write(buffer, i);
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ void TemplateFileServer::Serve(HTTP::Provider *server, const Anope::string &page
|
||||
Anope::string buf;
|
||||
|
||||
int i;
|
||||
char buffer[BUFSIZE];
|
||||
char buffer[1024];
|
||||
while ((i = read(fd, buffer, sizeof(buffer) - 1)) > 0)
|
||||
{
|
||||
buffer[i] = 0;
|
||||
|
||||
+1
-1
@@ -754,7 +754,7 @@ bool File::End() const
|
||||
Anope::string File::Read()
|
||||
{
|
||||
Anope::string ret;
|
||||
char buf[BUFSIZE];
|
||||
char buf[1024];
|
||||
while (fgets(buf, sizeof(buf), this->fp) != NULL)
|
||||
{
|
||||
char *nl = strchr(buf, '\n');
|
||||
|
||||
+1
-1
@@ -685,7 +685,7 @@ Anope::string Anope::strftime(time_t t, const NickCore *nc, bool short_output)
|
||||
tzset();
|
||||
}
|
||||
|
||||
char buf[BUFSIZE];
|
||||
char buf[256];
|
||||
strftime(buf, sizeof(buf), "%c", (nc ? localtime(&t) : gmtime(&t)));
|
||||
|
||||
if (nc)
|
||||
|
||||
Reference in New Issue
Block a user