summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-12-07 19:45:24 +0000
committerai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-12-07 19:45:24 +0000
commitee657a1fb7fa9b9f9f4d89bdaec4ef8544ccd739 (patch)
treefae0d7f7fd4be7e6e173e1eb0e2ccb48df40d7c5 /src/common
parente4b44bb0c6d412fe8d7e9f4877fe7f55356cb56d (diff)
downloadhercules-ee657a1fb7fa9b9f9f4d89bdaec4ef8544ccd739.tar.gz
hercules-ee657a1fb7fa9b9f9f4d89bdaec4ef8544ccd739.tar.bz2
hercules-ee657a1fb7fa9b9f9f4d89bdaec4ef8544ccd739.tar.xz
hercules-ee657a1fb7fa9b9f9f4d89bdaec4ef8544ccd739.zip
* Reverted r14563, due to multiple issues which render the source malfunctioning or uncompilable. To be redone later (bugreport:4627).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14567 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/common')
-rw-r--r--src/common/grfio.c14
-rw-r--r--src/common/lock.c6
-rw-r--r--src/common/malloc.c6
-rw-r--r--src/common/md5calc.c2
-rw-r--r--src/common/plugins.c2
-rw-r--r--src/common/utils.c4
6 files changed, 17 insertions, 17 deletions
diff --git a/src/common/grfio.c b/src/common/grfio.c
index 82bf57bf6..fe94e0803 100644
--- a/src/common/grfio.c
+++ b/src/common/grfio.c
@@ -398,7 +398,7 @@ int grfio_size(char* fname)
FILELIST lentry;
struct stat st;
- snprintf(lfname, sizeof lfname, "%s%s", data_dir, fname);
+ sprintf(lfname, "%s%s", data_dir, fname);
for (p = &lfname[0]; *p != 0; p++)
if (*p=='\\') *p = '/';
@@ -431,7 +431,7 @@ void* grfio_reads(char* fname, int* size)
char lfname[256], *p;
FILELIST lentry;
- snprintf(lfname, sizeof lfname, "%s%s", data_dir, fname);
+ sprintf(lfname, "%s%s", data_dir, fname);
for (p = &lfname[0]; *p != 0; p++)
if (*p == '\\') *p = '/';
@@ -694,7 +694,7 @@ static void grfio_resourcecheck(void)
int i = 0;
// read resnametable from data directory and return if successful
- snprintf(restable, sizeof restable, "%sdata\\resnametable.txt", data_dir);
+ sprintf(restable, "%sdata\\resnametable.txt", data_dir);
for (ptr = &restable[0]; *ptr != 0; ptr++)
if (*ptr == '\\') *ptr = '/';
@@ -706,8 +706,8 @@ static void grfio_resourcecheck(void)
// we only need the maps' GAT and RSW files
(strstr(w2, ".gat") || strstr(w2, ".rsw")))
{
- snprintf(src, sizeof src, "data\\%s", w1);
- snprintf(dst, sizeof dst, "data\\%s", w2);
+ sprintf(src, "data\\%s", w1);
+ sprintf(dst, "data\\%s", w2);
entry = filelist_find(dst);
// create new entries reusing the original's info
if (entry != NULL) {
@@ -735,8 +735,8 @@ static void grfio_resourcecheck(void)
if (sscanf(ptr, "%[^#]#%[^#]#", w1, w2) == 2 &&
(strstr(w2, ".gat") || strstr(w2, ".rsw")))
{
- snprintf(src, sizeof src, "data\\%s", w1);
- snprintf(dst, sizeof dst, "data\\%s", w2);
+ sprintf(src, "data\\%s", w1);
+ sprintf(dst, "data\\%s", w2);
entry = filelist_find(dst);
if (entry != NULL) {
FILELIST fentry;
diff --git a/src/common/lock.c b/src/common/lock.c
index a4bcc7fe0..643b86e5c 100644
--- a/src/common/lock.c
+++ b/src/common/lock.c
@@ -25,7 +25,7 @@ FILE* lock_fopen (const char* filename, int *info) {
// 安全なファイル名を得る(手抜き)
do {
- snprintf(newfile, sizeof newfile, "%s_%04d.tmp", filename, ++no);
+ sprintf(newfile, "%s_%04d.tmp", filename, ++no);
} while(exists(newfile) && no < 9999);
*info = no;
return fopen(newfile,"w");
@@ -38,8 +38,8 @@ int lock_fclose (FILE *fp, const char* filename, int *info) {
char oldfile[512];
if (fp != NULL) {
ret = fclose(fp);
- snprintf(newfile, sizeof newfile, "%s_%04d.tmp", filename, *info);
- snprintf(oldfile, sizeof oldfile, "%s.bak", filename); // old backup file
+ sprintf(newfile, "%s_%04d.tmp", filename, *info);
+ sprintf(oldfile, "%s.bak", filename); // old backup file
if (exists(oldfile)) remove(oldfile); // remove backup file if it already exists
rename (filename, oldfile); // backup our older data instead of deleting it
diff --git a/src/common/malloc.c b/src/common/malloc.c
index 57300c18f..b566e689f 100644
--- a/src/common/malloc.c
+++ b/src/common/malloc.c
@@ -602,7 +602,7 @@ static void memmgr_final (void)
char* ptr = (char *)head + sizeof(struct unit_head) - sizeof(long);
#ifdef LOG_MEMMGR
char buf[1024];
- snprintf (buf, sizeof buf,
+ sprintf (buf,
"%04d : %s line %d size %lu address 0x%p\n", ++count,
head->file, head->line, (unsigned long)head->size, ptr);
memmgr_log (buf);
@@ -619,7 +619,7 @@ static void memmgr_final (void)
struct unit_head_large *large2;
#ifdef LOG_MEMMGR
char buf[1024];
- snprintf (buf, sizeof buf,
+ sprintf (buf,
"%04d : %s line %d size %lu address 0x%p\n", ++count,
large->unit_head.file, large->unit_head.line, (unsigned long)large->size, &large->unit_head.checksum);
memmgr_log (buf);
@@ -642,7 +642,7 @@ static void memmgr_final (void)
static void memmgr_init (void)
{
#ifdef LOG_MEMMGR
- snprintf(memmer_logfile, sizeof memmer_logfile, "log/%s.leaks", SERVER_NAME);
+ sprintf(memmer_logfile, "log/%s.leaks", SERVER_NAME);
ShowStatus("Memory manager initialised: "CL_WHITE"%s"CL_RESET"\n", memmer_logfile);
memset(hash_unfill, 0, sizeof(hash_unfill));
#endif /* LOG_MEMMGR */
diff --git a/src/common/md5calc.c b/src/common/md5calc.c
index 08ad09ee1..2178739d6 100644
--- a/src/common/md5calc.c
+++ b/src/common/md5calc.c
@@ -222,7 +222,7 @@ void MD5_String(const char * string, char * output)
unsigned char digest[16];
MD5_String2binary(string,digest);
- snprintf(output, sizeof output, "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
+ sprintf(output, "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
digest[ 0], digest[ 1], digest[ 2], digest[ 3],
digest[ 4], digest[ 5], digest[ 6], digest[ 7],
digest[ 8], digest[ 9], digest[10], digest[11],
diff --git a/src/common/plugins.c b/src/common/plugins.c
index 614ac3c3a..2d81548a1 100644
--- a/src/common/plugins.c
+++ b/src/common/plugins.c
@@ -320,7 +320,7 @@ static int plugins_config_read(const char *cfgName)
auto_search = atoi(w2);
} else if( strcmpi(w1,"plugin") == 0 ){
char filename[128];
- snprintf(filename, sizeof filename, "plugins/%s%s", w2, DLL_EXT);
+ sprintf(filename, "plugins/%s%s", w2, DLL_EXT);
plugin_load(filename);
} else if( strcmpi(w1,"import") == 0 )
plugins_config_read(w2);
diff --git a/src/common/utils.c b/src/common/utils.c
index a95072f7d..12123784f 100644
--- a/src/common/utils.c
+++ b/src/common/utils.c
@@ -104,7 +104,7 @@ void findfile(const char *p, const char *pat, void (func)(const char*))
if (strcmp(FindFileData.cFileName, "..") == 0)
continue;
- snprintf(tmppath,sizeof tmppath,"%s%c%s",path,PATHSEP,FindFileData.cFileName);
+ sprintf(tmppath,"%s%c%s",path,PATHSEP,FindFileData.cFileName);
if (FindFileData.cFileName && strstr(FindFileData.cFileName, pattern)) {
func( tmppath );
@@ -166,7 +166,7 @@ void findfile(const char *p, const char *pat, void (func)(const char*))
if (strcmp(entry->d_name, "..") == 0)
continue;
- snprintf(tmppath,sizeof tmppath,"%s%c%s",path, PATHSEP, entry->d_name);
+ sprintf(tmppath,"%s%c%s",path, PATHSEP, entry->d_name);
// check if the pattern matchs.
if (entry->d_name && strstr(entry->d_name, pattern)) {