summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArun Prakash Jana <engineerarun@gmail.com>2023-05-08 00:03:30 +0530
committerArun Prakash Jana <engineerarun@gmail.com>2023-05-08 00:09:10 +0530
commitaf329e451617da68ae51227fdc65e355ddf9f34a (patch)
tree1b74240e83fc4b2d52e161a8b57aac10c5b72844
parentb19585d8e6a51b52d7e2aa94e32ccc0e586c4a80 (diff)
Do not store result on bc/calc errors
-rw-r--r--README.md4
-rw-r--r--src/bcal.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/README.md b/README.md
index 05b947d..01392e6 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,8 @@
<h1 align="center">bcal</h1>
<p align="center">
-<a href="https://github.com/jarun/bcal/releases/latest"><img src="https://img.shields.io/github/release/jarun/bcal.svg?maxAge=600" alt="Latest release" /></a>
-<a href="https://repology.org/project/bcal/versions"><img src="https://repology.org/badge/tiny-repos/bcal.svg" alt="Availability"></a>
+<a href="https://github.com/jarun/bcal/releases/latest"><img src="https://img.shields.io/github/release/jarun/bcal.svg?maxAge=600&label=rel" alt="Latest release" /></a>
+<a href="https://repology.org/project/bcal/versions"><img src="https://repology.org/badge/tiny-repos/bcal.svg?header=repos" alt="Availability"></a>
<a href="https://circleci.com/gh/jarun/workflows/bcal"><img src="https://img.shields.io/circleci/project/github/jarun/bcal.svg?label=circle%20ci" alt="CircleCI Status" /></a>
<a href="https://github.com/jarun/bcal/actions"><img src="https://github.com/jarun/bcal/workflows/ci/badge.svg?branch=master" alt="GitHub CI Status" /></a>
<a href="https://scan.coverity.com/projects/jarun-bcal"><img src="https://img.shields.io/coverity/scan/17148.svg" alt="Coverity Scan Build Status" /></a>
diff --git a/src/bcal.c b/src/bcal.c
index 093903c..9ca8b06 100644
--- a/src/bcal.c
+++ b/src/bcal.c
@@ -312,7 +312,7 @@ static int try_bc(char *expr)
buffer[ret] = '\0';
- if (buffer[0] != '(') {
+ if ((buffer[0] != '(') && (strncmp(buffer, "Warning", 7) != 0) && (strncmp(buffer, "Missing", 7) != 0)) {
ptr = buffer;
while (isspace(*ptr)) /* calc results have space before them */
++ptr;