Fixing crappy code in coke handler, debug in others
[tpg/opendispense2.git] / src / server / main.c
index 8ffcd54..0692d6a 100644 (file)
@@ -18,9 +18,9 @@
 #include <fcntl.h>
 #include <stdarg.h>
 #include <syslog.h>
+#include "../cokebank.h"
 
 // === IMPORTS ===
-extern void    Init_Cokebank(const char *Argument);    // cokebank.c
 extern void    Init_Handlers(void);
 extern void    Load_Itemlist(void);
 extern void    Server_Start(void);
@@ -85,7 +85,8 @@ int main(int argc, char *argv[])
        
        openlog("odispense2", 0, LOG_LOCAL4);
        
-       Init_Cokebank(gsCokebankPath);
+       if( Bank_Initialise(gsCokebankPath) )
+               return -1;
 
        Init_Handlers();
 
@@ -102,6 +103,9 @@ int RunRegex(regex_t *regex, const char *string, int nMatches, regmatch_t *match
         int    ret;
        
        ret = regexec(regex, string, nMatches, matches, 0);
+       if( ret == REG_NOMATCH ) {
+               return -1;
+       }
        if( ret ) {
                size_t  len = regerror(ret, regex, NULL, 0);
                char    errorStr[len];

UCC git Repository :: git.ucc.asn.au