kopia lustrzana https://github.com/jamescoxon/dl-fldigi
Fix unchecked retval warnings
rodzic
c3d55a6ce1
commit
ead061ffd9
|
@ -226,8 +226,13 @@ void QRZ::OpenQRZFiles( const char *fname )
|
|||
}
|
||||
memset( index, 0, idxsize );
|
||||
|
||||
fread( &idxhdr.dataname, 1, 48, idxfile );
|
||||
fread( index, 1, idxsize, idxfile ) ;
|
||||
if (fread( &idxhdr.dataname, 1, 48, idxfile ) != 1 ||
|
||||
fread( index, 1, idxsize, idxfile ) != 1) {
|
||||
fclose( idxfile );
|
||||
free( index );
|
||||
QRZvalid = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
fflush( stdout );
|
||||
|
||||
|
|
|
@ -62,7 +62,14 @@ void loadPalette()
|
|||
if (!p) return;
|
||||
if ((clrfile = fopen(p, "r")) != NULL) {
|
||||
for (int i = 0; i < 9; i++) {
|
||||
fscanf(clrfile, "%d;%d;%d\n", &r, &g, &b);
|
||||
if (fscanf(clrfile, "%d;%d;%d\n", &r, &g, &b) == EOF) {
|
||||
if (ferror(clrfile))
|
||||
perror("fscanf");
|
||||
else
|
||||
cerr << p << ": unexpected EOF\n";
|
||||
fclose(clrfile);
|
||||
return;
|
||||
}
|
||||
palette[i].R = r;
|
||||
palette[i].G = g;
|
||||
palette[i].B = b;
|
||||
|
|
Ładowanie…
Reference in New Issue