1
0
mirror of git://projects.qi-hardware.com/imgv.git synced 2024-11-27 16:56:15 +02:00

use argv[1] as filename

Signed-off-by: Xiangfu Liu <xiangfu@sharism.cc>
This commit is contained in:
Xiangfu Liu 2010-05-30 23:41:14 +08:00
parent 6525c34980
commit 9858e27172

View File

@ -42,8 +42,8 @@ int main(int argc, char *argv[])
rightPressed,
upPressed,
downPressed;
char sFilename[255] = "\0",
sVersion[] = "0.2.1";
char * sFilename;
char sVersion[] = "0.2.1";
double scale_x = 1.0,
scale_y = 1.0,
scale = 1.0;
@ -54,10 +54,17 @@ int main(int argc, char *argv[])
// Process command line
if (argc != 2)
{
fprintf (stderr, "\n imgv v%s. Syntax: imgv <image file>\n\n Hotkeys:\n 'f' fit to screen\n 'z' zoom at pixel level\n 'i' zoom in 'o' zoom out\n 'l' rotate left 'r' rotate right\n 'arrows' pan 'ESC' quit\n\n", sVersion);
fprintf (stderr, "\n"
" imgv v%s. Syntax: imgv <image file>\n\n"
" Hotkeys:\n"
" 'f' fit to screen\n"
" 'z' zoom at pixel level\n"
" 'i' zoom in 'o' zoom out\n"
" 'l' rotate left 'r' rotate right\n"
" 'arrows' pan 'ESC' quit\n\n", sVersion);
exit (1);
}
strncpy (sFilename, argv[1], 254);
sFilename = argv[1];
// Initialize the SDL library
if (SDL_Init(SDL_INIT_VIDEO) < 0)