From 3aa3ddcb5a95a03d745a3e4b7948f1f9ccf4721b Mon Sep 17 00:00:00 2001 From: angelo Date: Mon, 24 Jun 1996 12:47:00 +0000 Subject: [PATCH] Corretta l'apertura del file di history per togliere unexepected quickwin error sulla conversione. git-svn-id: svn://10.65.10.50/trunk@3077 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- ba/ba1100.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ba/ba1100.cpp b/ba/ba1100.cpp index 53d1b467d..942a4ced0 100755 --- a/ba/ba1100.cpp +++ b/ba/ba1100.cpp @@ -347,14 +347,16 @@ void TManutenzione_app::open_history() { char line[16]; fgets(line,16,fp); - line[strlen(line) -1] = '\0'; - if (strlen(line)==0) _history_firm = -1; + int l = strlen(line); + + line[l > 0 ? l -1 : 0 ] = '\0'; + if (l==0) _history_firm = -1; else _history_firm = atol(line); } else { - fopen(History_file,"w"); + fp = fopen(History_file,"w"); _history_firm = -1; } fclose (fp);