summaryrefslogtreecommitdiff
path: root/src/map/clif.cpp
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2013-11-15 17:51:29 -0800
committerBen Longbons <b.r.longbons@gmail.com>2013-11-15 17:51:29 -0800
commitf906959a09d58c85d87b445fd1791d91bf278bfa (patch)
treeb65282b2c731d4eb2157ae719828cddf6b086943 /src/map/clif.cpp
parent1fb7ce5a604db78c4d02f719053827269705ce13 (diff)
downloadtmwa-f906959a09d58c85d87b445fd1791d91bf278bfa.tar.gz
tmwa-f906959a09d58c85d87b445fd1791d91bf278bfa.tar.bz2
tmwa-f906959a09d58c85d87b445fd1791d91bf278bfa.tar.xz
tmwa-f906959a09d58c85d87b445fd1791d91bf278bfa.zip
Use new IO classes
Diffstat (limited to 'src/map/clif.cpp')
-rw-r--r--src/map/clif.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/map/clif.cpp b/src/map/clif.cpp
index 0ac518e..1a38ebe 100644
--- a/src/map/clif.cpp
+++ b/src/map/clif.cpp
@@ -10,6 +10,8 @@
#include "../strings/zstring.hpp"
#include "../strings/xstring.hpp"
+#include "../io/write.hpp"
+
#include "../common/cxxstdio.hpp"
#include "../common/md5calc.hpp"
#include "../common/random.hpp"
@@ -5536,8 +5538,7 @@ void clif_parse(int fd)
#ifdef DUMP_UNKNOWN_PACKET
{
int i;
- FILE *fp;
- char packet_txt[256] = "save/packet.txt";
+ ZString packet_txt = "save/packet.txt";
PRINTF("---- 00-01-02-03-04-05-06-07-08-09-0A-0B-0C-0D-0E-0F");
for (i = 0; i < packet_len; i++)
{
@@ -5554,7 +5555,8 @@ void clif_parse(int fd)
else if (sd) // not authentified! (refused by char-server or disconnect before to be authentified)
PRINTF("\nAccount ID %d.\n", sd->bl_id);
- if ((fp = fopen(packet_txt, "a")) == NULL)
+ io::AppendFile fp(packet_txt);
+ if (!fp.is_open())
{
PRINTF("clif.c: cant write [%s] !!! data is lost !!!\n",
packet_txt);
@@ -5586,7 +5588,6 @@ void clif_parse(int fd)
FPRINTF(fp, "%02X ", RFIFOB(fd, i));
}
FPRINTF(fp, "\n\n");
- fclose(fp);
}
}
#endif