浏览代码

Assing support of NULL entries in question_t.

Assuming that setup(), teardown(), test() might be NULL if there's really
nothing to do.
Michele Orrù 11 年之前
父节点
当前提交
130925f9fe
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      src/qa.c

+ 3 - 3
src/qa.c

@@ -69,10 +69,10 @@ int qa_init(const struct qa_conf* conf)
 
   register_all_questions();
   for (q=questions.lh_first; q; q = q->qs.le_next) {
-    q->setup();
-    q->test(crt);
+    if (q->setup)    q->setup();
+    if (q->test)     q->test(crt);
     q->ask(crt);
-    q->teardown();
+    if (q->teardown) q->teardown();
   }
 
   X509_free(crt);