#include "common.h"
#include <stdlib.h>
#include <limits.h>
+#include <string.h>
int _GetMinBalance(int Account);
int _CanTransfer(int Source, int Destination, int Ammount);
{
int flags = Bank_GetFlags(Account);
+ // Evil little piece of HACK:
+ // root's balance cannot be changed by any of the above functions
+ // - Stops dispenses as root by returning insufficent balance.
+ {
+ char *username = Bank_GetAcctName(Account);
+ if( strcmp(username, "root") == 0 )
+ {
+ free(username);
+ return INT_MAX;
+ }
+ free(username);
+ }
+
// - Internal accounts have no lower bound
if( flags & USER_FLAG_INTERNAL ) return INT_MIN;
// Admin to -$10
- if( flags & USER_FLAG_ADMIN ) return -1000;
+ //if( flags & USER_FLAG_ADMIN ) return -1000;
// Coke to -$5
- if( flags & USER_FLAG_COKE ) return -500;
+ //if( flags & USER_FLAG_COKE ) return -500;
// Anyone else, non-negative
return 0;