diff options
author | Lukas Fleischer <calcurse@cryptocrack.de> | 2011-04-05 09:37:20 +0200 |
---|---|---|
committer | Lukas Fleischer <calcurse@cryptocrack.de> | 2011-04-05 09:37:20 +0200 |
commit | a5a9ee60d62c02219ab5f2430335646beda59bc7 (patch) | |
tree | 11b8a9320a260ed9bac3cebd7bc8fe06812a6b28 | |
parent | 6fb0f6f4c6c5e17b9485fc666823feede35723b9 (diff) | |
download | calcurse-a5a9ee60d62c02219ab5f2430335646beda59bc7.tar.gz calcurse-a5a9ee60d62c02219ab5f2430335646beda59bc7.zip |
Fix bad use of unsigned integers.
Unsigned values should never be compared to values less than zero.
Detected with "find_unsigned.cocci" spatch from
http://coccinelle.lip6.fr/impact_linux.php.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
-rw-r--r-- | src/custom.c | 5 | ||||
-rw-r--r-- | src/mem.c | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/src/custom.c b/src/custom.c index e8cf0fe..1169b18 100644 --- a/src/custom.c +++ b/src/custom.c @@ -270,9 +270,10 @@ custom_load_conf (struct conf *conf, int background) var = 0; break; case CUSTOM_CONF_PERIODICSAVE: - conf->periodic_save = atoi (e_conf); - if (conf->periodic_save < 0) + if (atoi (e_conf) < 0) conf->periodic_save = 0; + else + conf->periodic_save = atoi (e_conf); var = 0; break; case CUSTOM_CONF_CONFIRMQUIT: @@ -95,8 +95,6 @@ stats_del_blk (unsigned id) { struct mem_blk *o, **i; - EXIT_IF (id < 0, _("Incorrect block id")); - i = &mstats.blk; for (o = mstats.blk; o; o = o->next) { |