GraphBuffer[GraphTraceLen] = atoi(line);
GraphTraceLen++;
}
- fclose(f);
+ if (f) {
+ fclose(f);
+ f = NULL;
+ }
PrintAndLog("loaded %d samples", GraphTraceLen);
RepaintGraphWindow();
return 0;
for (i = 0; i < GraphTraceLen; i++) {
fprintf(f, "%d\n", GraphBuffer[i]);
}
- fclose(f);
+ if (f) {
+ fclose(f);
+ f = NULL;
+ }
PrintAndLog("saved to '%s'", Cmd);
return 0;
}