From 0b88c2a4398a89c5707a19a77569a79c2331d340 Mon Sep 17 00:00:00 2001 From: Chris Maffeo <cmaffeo2@illinois.edu> Date: Mon, 30 Sep 2019 16:19:14 -0500 Subject: [PATCH] Abort when TabulatedPotential::countValueLines cannot open file --- src/TabulatedPotential.cu | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/TabulatedPotential.cu b/src/TabulatedPotential.cu index b4548ed..bac8472 100644 --- a/src/TabulatedPotential.cu +++ b/src/TabulatedPotential.cu @@ -97,6 +97,10 @@ TabulatedPotential::~TabulatedPotential() { int TabulatedPotential::countValueLines(const char* fileName) { FILE* inp = fopen(fileName, "r"); + if (inp == NULL) { + printf("TabulatedPotential::countValueLines Could not open file '%s'\n", fileName); + exit(-1); + } char line[256]; int count = 0; -- GitLab