From e30cf17140e311230522308175ea970ebfffbadd Mon Sep 17 00:00:00 2001 From: Andre Date: Tue, 2 May 2006 16:58:32 +0200 Subject: [PATCH] grab_client: Error out if given an invalid grab mode --- grab_client.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/grab_client.c b/grab_client.c index ee07d875..b58c456e 100644 --- a/grab_client.c +++ b/grab_client.c @@ -85,6 +85,7 @@ rewrite: return ret; } +/* TODO: gengetopt can handle the grab client modes */ static int check_gc_args(struct grab_client *gc) { int i; @@ -95,6 +96,8 @@ static int check_gc_args(struct grab_client *gc) for (i = 0; mv[i]; i++) if (!strcmp(conf->mode_arg, mv[i])) break; + if (!mv[i]) + return -E_GC_SYNTAX; gc->mode = i; if (conf->audio_format_given) { gc->audio_format_num = get_audio_format_num(conf->audio_format_arg); -- 2.39.2