From: Ben Pfaff Date: Sat, 30 May 2009 04:51:45 +0000 (-0700) Subject: argv-parser: Add assertion to find likely bugs in client code. X-Git-Tag: v0.7.3~61 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b8cb6538550b50fe8638a3bdcc01268ebd56415e;p=pspp-builds.git argv-parser: Add assertion to find likely bugs in client code. --- diff --git a/src/libpspp/argv-parser.c b/src/libpspp/argv-parser.c index b3dc4613..ecf1ab23 100644 --- a/src/libpspp/argv-parser.c +++ b/src/libpspp/argv-parser.c @@ -78,6 +78,7 @@ argv_parser_add_options (struct argv_parser *ap, ap->options = x2nrealloc (ap->options, &ap->allocated_options, sizeof *ap->options); + assert (src->long_name != NULL || src->short_name != 0); dst = &ap->options[ap->n_options++]; dst->base = *src; dst->cb = cb;