summaryrefslogtreecommitdiff
path: root/src/common/sql.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2014-11-16 06:35:51 +0100
committerHaru <haru@dotalux.com>2014-11-16 07:16:23 +0100
commit02fcaed6bd32b0ffbc4f03b8f9de6f0720e6253f (patch)
tree3161fd5786bb563c32059068eb3b4876d2ae11ca /src/common/sql.c
parent31bff051ee3c353fb7ee5e544d68feeaefd4941f (diff)
downloadhercules-02fcaed6bd32b0ffbc4f03b8f9de6f0720e6253f.tar.gz
hercules-02fcaed6bd32b0ffbc4f03b8f9de6f0720e6253f.tar.bz2
hercules-02fcaed6bd32b0ffbc4f03b8f9de6f0720e6253f.tar.xz
hercules-02fcaed6bd32b0ffbc4f03b8f9de6f0720e6253f.zip
Whitespace cleanup (no code changes)
This includes, and is not limited to: mixed or wrong indentation, excess whitespace (horizontal and vertical), misalignment, trailing spaces. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/common/sql.c')
-rw-r--r--src/common/sql.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/common/sql.c b/src/common/sql.c
index c75b90cec..7f89e9828 100644
--- a/src/common/sql.c
+++ b/src/common/sql.c
@@ -1004,10 +1004,10 @@ void Sql_HerculesUpdateCheck(Sql* self) {
FILE* ifp;/* index fp */
unsigned int performed = 0;
StringBuf buf;
-
+
if( self == NULL )
return;/* return silently, build has no mysql connection */
-
+
if( !( ifp = fopen("sql-files/upgrades/index.txt", "r") ) ) {
ShowError("SQL upgrade index was not found!\n");
return;
@@ -1055,7 +1055,7 @@ void Sql_HerculesUpdateCheck(Sql* self) {
ShowMessage("%s",StrBuf->Value(&buf));
ShowSQL("To manually skip, type: 'sql update skip <file name>'\n");
}
-
+
StrBuf->Destroy(&buf);
}
@@ -1063,21 +1063,21 @@ void Sql_HerculesUpdateSkip(Sql* self,const char *filename) {
char path[41];// "sql-files/upgrades/" (19) + "yyyy-mm-dd--hh-mm" (17) + ".sql" (4) + 1
char timestamp[11];// "1360186680" (10) + 1
FILE* ifp;/* index fp */
-
+
if( !self ) {
ShowError("SQL not hooked!\n");
return;
}
-
+
snprintf(path,41,"sql-files/upgrades/%s",filename);
-
+
if( !( ifp = fopen(path, "r") ) ) {
ShowError("Upgrade file '%s' was not found!\n",filename);
return;
}
-
+
fseek (ifp,1,SEEK_SET);/* woo. skip the # */
-
+
if( 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) )