summaryrefslogtreecommitdiff
path: root/src/char/int_storage.c
diff options
context:
space:
mode:
authorParadox924X <Paradox924X@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-12-07 18:38:03 +0000
committerParadox924X <Paradox924X@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-12-07 18:38:03 +0000
commit663c9c7ce25d3df3749c55c28af162c46015bc92 (patch)
tree29acf07133e1b5b1bc055481c5667b4133e740cf /src/char/int_storage.c
parent53daf01b4b07ce131c79fc784220ba6826e70d16 (diff)
downloadhercules-663c9c7ce25d3df3749c55c28af162c46015bc92.tar.gz
hercules-663c9c7ce25d3df3749c55c28af162c46015bc92.tar.bz2
hercules-663c9c7ce25d3df3749c55c28af162c46015bc92.tar.xz
hercules-663c9c7ce25d3df3749c55c28af162c46015bc92.zip
Changed almost all instances of sprintf() to snprintf().
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14563 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/char/int_storage.c')
-rw-r--r--src/char/int_storage.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/char/int_storage.c b/src/char/int_storage.c
index bae72fcf4..ff682da87 100644
--- a/src/char/int_storage.c
+++ b/src/char/int_storage.c
@@ -31,17 +31,17 @@ bool storage_tostr(char* str, int account_id, struct storage_data* p)
{
int i,j;
char *str_p = str;
- str_p += sprintf(str_p, "%d,%d\t", account_id, p->storage_amount);
+ str_p += snprintf(str_p, sizeof str_p, "%d,%d\t", account_id, p->storage_amount);
for( i = 0; i < MAX_STORAGE; i++ )
if( p->items[i].nameid > 0 && p->items[i].amount > 0 )
{
- str_p += sprintf(str_p, "%d,%d,%d,%d,%d,%d,%d",
+ str_p += snprintf(str_p, sizeof str_p, "%d,%d,%d,%d,%d,%d,%d",
p->items[i].id,p->items[i].nameid,p->items[i].amount,p->items[i].equip,
p->items[i].identify,p->items[i].refine,p->items[i].attribute);
for(j=0; j<MAX_SLOTS; j++)
- str_p += sprintf(str_p,",%d",p->items[i].card[j]);
- str_p += sprintf(str_p," ");
+ str_p += snprintf(str_p,sizeof str_p,",%d",p->items[i].card[j]);
+ str_p += snprintf(str_p,sizeof str_p," ");
}
*(str_p++)='\t';
@@ -98,16 +98,16 @@ int guild_storage_tostr(char *str,struct guild_storage *p)
{
int i,j,f=0;
char *str_p = str;
- str_p+=sprintf(str,"%d,%d\t",p->guild_id,p->storage_amount);
+ str_p+=snprintf(str,sizeof str,"%d,%d\t",p->guild_id,p->storage_amount);
for(i=0;i<MAX_GUILD_STORAGE;i++)
if( (p->storage_[i].nameid) && (p->storage_[i].amount) ){
- str_p += sprintf(str_p,"%d,%d,%d,%d,%d,%d,%d",
+ str_p += snprintf(str_p,sizeof str_p,"%d,%d,%d,%d,%d,%d,%d",
p->storage_[i].id,p->storage_[i].nameid,p->storage_[i].amount,p->storage_[i].equip,
p->storage_[i].identify,p->storage_[i].refine,p->storage_[i].attribute);
for(j=0; j<MAX_SLOTS; j++)
- str_p += sprintf(str_p,",%d",p->storage_[i].card[j]);
- str_p += sprintf(str_p," ");
+ str_p += snprintf(str_p,sizeof str_p,",%d",p->storage_[i].card[j]);
+ str_p += snprintf(str_p,sizeof str_p," ");
f++;
}