TOOLS/: minor fixes in tool code

Fix printf format string warning

fixes this warning:
asfinfo.c: In function 'print_video_header':
asfinfo.c:158: warning: format '%.4s' expects type 'char *', but argument 3 has type 'long int *'

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32774 b3059339-0415-0410-9bf9-f77b7e298cf2

add missing fclose

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32775 b3059339-0415-0410-9bf9-f77b7e298cf2

add missing fclose()

found by cppcheck:
[avisubdump.c:199]: (error) Resource leak: f

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32776 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
siretart 2011-01-09 20:02:45 +00:00 committed by Uoti Urpala
parent 9a021242a9
commit 65cc2366a3
2 changed files with 9 additions and 3 deletions

View File

@ -155,7 +155,7 @@ static void print_video_header(BITMAPINFOHEADER *h){
printf(" biHeight %ld\n", h->biHeight);
printf(" biPlanes %d\n", h->biPlanes);
printf(" biBitCount %d\n", h->biBitCount);
printf(" biCompression %ld='%.4s'\n", h->biCompression, &h->biCompression);
printf(" biCompression %ld='%.4s'\n", h->biCompression, (const char*)&h->biCompression);
printf(" biSizeImage %ld\n", h->biSizeImage);
printf("===========================\n");
}
@ -284,5 +284,6 @@ int main(int argc, char* argv[]){
fseek(f, pos + objh.size - sizeof(objh), SEEK_SET);
}
fclose(f);
return 0;
}

View File

@ -180,8 +180,12 @@ int main(int argc,char* argv[])
exit(1);
}
if (strcmp(argv[argc-1], "-") == 0) f=stdin;
else f=fopen(argv[argc-1],"rb");
if (strcmp(argv[argc-1], "-") == 0) {
dump(stdin);
return 0;
}
f=fopen(argv[argc-1],"rb");
if (!f) {
fprintf(stderr, "Could not open '%s': %s\n",
@ -190,6 +194,7 @@ int main(int argc,char* argv[])
}
dump(f);
fclose(f);
return 0;
}