diff --git a/prism/src/sparse/PS_NondetMultiObj.cc b/prism/src/sparse/PS_NondetMultiObj.cc index efeeac79..2a7299d2 100644 --- a/prism/src/sparse/PS_NondetMultiObj.cc +++ b/prism/src/sparse/PS_NondetMultiObj.cc @@ -305,9 +305,7 @@ JNIEXPORT jdoubleArray __jlongpointer JNICALL Java_sparse_PrismSparse_PS_1Nondet // open file to store adversary (if required) if (export_adv_enabled != EXPORT_ADV_NONE) { fp_adv = fopen(export_adv_filename, "w"); - if (fp_adv) { - fprintf(fp_adv, "%d ?\n", n); - } else { + if (!fp_adv) { PS_PrintWarningToMainLog(env, "Adversary generation cancelled (could not open file \"%s\").", export_adv_filename); export_adv_enabled = EXPORT_ADV_NONE; } diff --git a/prism/src/sparse/PS_NondetReachReward.cc b/prism/src/sparse/PS_NondetReachReward.cc index 5350b4b7..0221a66f 100644 --- a/prism/src/sparse/PS_NondetReachReward.cc +++ b/prism/src/sparse/PS_NondetReachReward.cc @@ -228,9 +228,7 @@ jboolean min // min or max probabilities (true = min, false = max) // open file to store adversary (if required) if (export_adv_enabled != EXPORT_ADV_NONE) { fp_adv = fopen(export_adv_filename, "w"); - if (fp_adv) { - fprintf(fp_adv, "%d ?\n", n); - } else { + if (!fp_adv) { PS_PrintWarningToMainLog(env, "Adversary generation cancelled (could not open file \"%s\").", export_adv_filename); export_adv_enabled = EXPORT_ADV_NONE; }