aboutsummarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntony Kellermann2018-07-15 15:36:16 -0400
committerAntony Kellermann2018-07-15 15:36:16 -0400
commit3cecf33b7bb9c452926a08e773d718234cc51f85 (patch)
treebbd21b75f7174a15c346895a096473f01f0cb7cc
parent58e4561e4934334b2804efc62179599c08c41d66 (diff)
downloadaur-3cecf33b7bb9c452926a08e773d718234cc51f85.tar.gz
Made it so porfolio_modify_string arguments cannot be negative
-rw-r--r--portfolio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/portfolio.c b/portfolio.c
index a31bbe2622d0..ae8b271e829e 100644
--- a/portfolio.c
+++ b/portfolio.c
@@ -55,7 +55,7 @@ void portfolio_modify_write(const char* symbol, double quantity_shares, double u
int portfolio_modify_string(String* pString, const char* symbol, double quantity_shares,
double usd_spent, int mod_option) {
- if (symbol != NULL && symbol[0] == '\0')
+ if ((symbol != NULL && symbol[0] == '\0') || quantity_shares < 0 || usd_spent < 0)
return 1;
int status = 0;