Replace more snprintf by UTIL_Format.

This commit is contained in:
Arkshine
2014-08-08 12:44:37 +02:00
parent c22bb12c1e
commit b47aa6871d
61 changed files with 417 additions and 72 deletions

View File

@ -11,15 +11,12 @@
// SQLite Module
//
#include <string.h>
#include <stdio.h>
#include "amxxmodule.h"
#include "SqliteHeaders.h"
#include "SqliteDriver.h"
#include "SqliteDatabase.h"
#if defined WIN32
#define snprintf _snprintf
#define strncasecmp strnicmp
#define WINDOWS_LEAN_AND_MEAN
#include <windows.h>
#else
@ -65,7 +62,7 @@ IDatabase *SqliteDriver::Connect(DatabaseInfo *info, int *errcode, char *error,
}
if (error)
{
snprintf(error, maxlength, "%s", sqlite3_errmsg(pSql));
UTIL_Format(error, maxlength, "%s", sqlite3_errmsg(pSql));
}
sqlite3_close(pSql);
return NULL;

View File

@ -11,16 +11,11 @@
// SQLite Module
//
#include <stdio.h>
#include <string.h>
#include "amxxmodule.h"
#include "SqliteQuery.h"
#include "SqliteDatabase.h"
#include "SqliteResultSet.h"
#if defined WIN32
#define snprintf _snprintf
#endif
using namespace SourceMod;
SqliteQuery::SqliteQuery(SqliteDatabase *db, const char *query) :
@ -97,7 +92,7 @@ bool SqliteQuery::ExecuteR(QueryInfo *info, char *error, size_t maxlength)
{
if (error && maxlength && errmsg)
{
snprintf(error, maxlength, "%s", errmsg);
UTIL_Format(error, maxlength, "%s", errmsg);
}
info->affected_rows = 0;
info->errorcode = err;