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
This commit is contained in:
angelo 1996-06-24 12:47:00 +00:00
parent cbf4689bfe
commit 3aa3ddcb5a

View File

@ -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);