argv[2] is now optional
- it is complained by captive_init() if not present
#include <captive/client.h> /* for captive_init() */
+void captive_sandbox_init(void);
+
int main(int argc,char **argv)
{
+ if (argc>3) {
+ fprintf(stderr,"Syntax: captivecmdline <captive_args> <image_filename>");
+ exit(EXIT_FAILURE);
+ }
+
if (!captive_init(argv[1],
- g_io_channel_new_file( /* FIXME: g_io_channel_new_file() is NOT 64-bit compliant! */
+ (!argv[2] ? NULL : g_io_channel_new_file( /* FIXME: g_io_channel_new_file() is NOT 64-bit compliant! */
argv[2], /* filename */
"r", /* mode */
- NULL))) /* error */
+ NULL)))) /* error */
g_error(_("captive_init FAIL"));
return EXIT_SUCCESS;