Fixed some segfaults due not checking for null pointers
This commit is contained in:
parent
a5e4be6a09
commit
13880cca63
@@ -20,5 +20,9 @@ typedef struct account {
|
||||
|
||||
} Account;
|
||||
|
||||
Account *initializeAccount(char *name, char *description);
|
||||
void updateAccountValue(Account *account, Money *value);
|
||||
void addSubAccountToAccount(Account *account, SubAccount *subaccount);
|
||||
void destroyAccount(Account *account);
|
||||
|
||||
#endif
|
||||
|
||||
+5
-1
@@ -20,6 +20,10 @@ typedef struct entry {
|
||||
struct entry *next; ///< Pointer to the next entry in the list of entries
|
||||
} Entry;
|
||||
|
||||
|
||||
Entry *initializeEntry(char *name, char *description);
|
||||
void setEntryValue(Entry *entry, Money *value);
|
||||
void appendEntry(Entry *entry, Entry *newEntry);
|
||||
void traverseEntry(Entry *entry);
|
||||
void destroyEntry(Entry *entry);
|
||||
|
||||
#endif
|
||||
+8
-2
@@ -19,9 +19,15 @@ typedef struct money {
|
||||
int cents; ///< The Cents parts of the monetary value
|
||||
} Money;
|
||||
|
||||
Money *initializeMoney(int full, int cents);
|
||||
Money *initalizeMoney(int full, int cents);
|
||||
|
||||
void addMoneyToMoney(Money *dest, Money *src);
|
||||
void subtractMoneyToMoney(Money *dest, Money *src);
|
||||
|
||||
bool checkOverflow(Money *m);
|
||||
bool checkUnderflow(Money *m);
|
||||
void handleOverflow(Money *m);
|
||||
void handleUnderflow(Money *m);
|
||||
void setMoneyValue(Money *m, int full, int cents);
|
||||
char *getMoneyString(Money *m);
|
||||
void destroyMoney(Money *money);
|
||||
#endif
|
||||
@@ -24,5 +24,10 @@ typedef struct subaccount {
|
||||
struct subaccount *next; ///< Reference to the next subaccount
|
||||
} SubAccount;
|
||||
|
||||
SubAccount *initializeSubAccount(char *name, char *description);
|
||||
void updateSubAccountValue(SubAccount *subaccount, Money *value);
|
||||
void addEntryToSubAccount(SubAccount *subaccount, Entry *entry);
|
||||
void appendSubAccount(SubAccount *subaccount, SubAccount *newSubaccount);
|
||||
void destroySubAccount(SubAccount *subaccount);
|
||||
|
||||
#endif
|
||||
+3
-1
@@ -18,5 +18,7 @@ typedef struct taccount {
|
||||
|
||||
} TAccount;
|
||||
|
||||
|
||||
TAccount *initializeTAccount();
|
||||
void destroyTAccount(TAccount *taccount);
|
||||
Account *getListAccountsPointers(TAccount *tAccount);
|
||||
#endif
|
||||
Reference in New Issue
Block a user