aboutsummaryrefslogtreecommitdiff
path: root/bp.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2021-01-18 09:15:25 -0800
committerBruce Hill <bruce@bruce-hill.com>2021-01-18 09:15:25 -0800
commit3ededef53d0704f8b89c55f60bef52a64b86d62c (patch)
tree686fc67dcc174e4ae729408577c93a25fab2592b /bp.c
parent65141b240218df4c40196db63429b90b1cb698a9 (diff)
Static analysis part 1
Diffstat (limited to 'bp.c')
-rw-r--r--bp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/bp.c b/bp.c
index f23e830..3ae703c 100644
--- a/bp.c
+++ b/bp.c
@@ -65,10 +65,10 @@ static enum {
} mode = MODE_NORMAL;
// If a filename is put here, it will be deleted if a signal is received
-const char *in_use_tempfile = NULL;
+static const char *in_use_tempfile = NULL;
// Used for user input/output that doesn't interfere with unix pipeline
-FILE *tty_out = NULL, *tty_in = NULL;
+static FILE *tty_out = NULL, *tty_in = NULL;
//
// Helper function to reduce code duplication
@@ -616,8 +616,8 @@ int main(int argc, char *argv[])
}
if (mode == MODE_JSON) printf("]\n");
- if (tty_out) fclose(tty_out);
- if (tty_in) fclose(tty_in);
+ if (tty_out) { fclose(tty_out); tty_out = NULL; }
+ if (tty_in) { fclose(tty_in); tty_in = NULL; }
#ifdef DEBUG_HEAP
// This code frees up all residual heap-allocated memory. Since the program