diff options
author | Arun Prakash Jana <engineerarun@gmail.com> | 2023-05-08 00:03:30 +0530 |
---|---|---|
committer | Arun Prakash Jana <engineerarun@gmail.com> | 2023-05-08 00:09:10 +0530 |
commit | af329e451617da68ae51227fdc65e355ddf9f34a (patch) | |
tree | 1b74240e83fc4b2d52e161a8b57aac10c5b72844 | |
parent | b19585d8e6a51b52d7e2aa94e32ccc0e586c4a80 (diff) |
Do not store result on bc/calc errors
-rw-r--r-- | README.md | 4 | ||||
-rw-r--r-- | src/bcal.c | 2 |
2 files changed, 3 insertions, 3 deletions
@@ -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> @@ -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; |