Skip to content

Commit

Permalink
Do not store result on bc/calc errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jarun committed May 7, 2023
1 parent b19585d commit af329e4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions 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>
Expand Down
2 changes: 1 addition & 1 deletion src/bcal.c
Expand Up @@ -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;
Expand Down

0 comments on commit af329e4

Please sign in to comment.