summaryrefslogtreecommitdiff
path: root/src/common/sql.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-01-24 03:42:16 +0100
committerHaru <haru@dotalux.com>2015-01-24 03:42:36 +0100
commita75714ca455c728d34918dd12200fcec87ebc0d4 (patch)
treed95d174b239a14fafdb8e824bad4a9c81a5a5a80 /src/common/sql.c
parentdf8d6560fc7eb34806d27d28b8b7dbce36868c24 (diff)
downloadhercules-a75714ca455c728d34918dd12200fcec87ebc0d4.tar.gz
hercules-a75714ca455c728d34918dd12200fcec87ebc0d4.tar.bz2
hercules-a75714ca455c728d34918dd12200fcec87ebc0d4.tar.xz
hercules-a75714ca455c728d34918dd12200fcec87ebc0d4.zip
Fixed 18 minor issues
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/common/sql.c')
-rw-r--r--src/common/sql.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/common/sql.c b/src/common/sql.c
index aec2ae93d..4ca14d43b 100644
--- a/src/common/sql.c
+++ b/src/common/sql.c
@@ -1027,9 +1027,8 @@ void Sql_HerculesUpdateCheck(Sql* self) {
continue;
}
- fseek (ufp,1,SEEK_SET);/* woo. skip the # */
-
- if( fgets(timestamp,sizeof(timestamp),ufp) ) {
+ if (fseek(ufp,1,SEEK_SET) == 0 /* woo. skip the # */
+ && fgets(timestamp,sizeof(timestamp),ufp)) {
unsigned int timestampui = (unsigned int)atol(timestamp);
if( SQL_ERROR == SQL->Query(self, "SELECT 1 FROM `sql_updates` WHERE `timestamp` = '%u' LIMIT 1", timestampui) )
Sql_ShowDebug(self);
@@ -1070,9 +1069,8 @@ void Sql_HerculesUpdateSkip(Sql* self,const char *filename) {
return;
}
- fseek (ifp,1,SEEK_SET);/* woo. skip the # */
-
- if( fgets(timestamp,sizeof(timestamp),ifp) ) {
+ if (fseek (ifp,1,SEEK_SET) == 0 /* woo. skip the # */
+ && fgets(timestamp,sizeof(timestamp),ifp)) {
unsigned int timestampui = (unsigned int)atol(timestamp);
if( SQL_ERROR == SQL->Query(self, "SELECT 1 FROM `sql_updates` WHERE `timestamp` = '%u' LIMIT 1", timestampui) )
Sql_ShowDebug(self);