projects
/
ccan
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
072d358
)
ccanlint: protect against the function element in the doc section being null
author
Brad Hards
<bradh@frogmouth.net>
Wed, 19 Jan 2011 06:03:32 +0000
(17:03 +1100)
committer
Rusty Russell
<rusty@rustcorp.com.au>
Sat, 22 Jan 2011 02:04:27 +0000
(12:34 +1030)
This can happen if the documentation doesn't have a properly formatted summary line,
and it causes the examples_relevant test to segfault.
tools/ccanlint/tests/examples_relevant.c
patch
|
blob
|
history
diff --git
a/tools/ccanlint/tests/examples_relevant.c
b/tools/ccanlint/tests/examples_relevant.c
index 283e78c10cda3914ce3ccaaad328c31be94d5f89..66dee27e65c427cc91bd4f67a5a7e1b04fe7f292 100644
(file)
--- a/
tools/ccanlint/tests/examples_relevant.c
+++ b/
tools/ccanlint/tests/examples_relevant.c
@@
-30,6
+30,11
@@
static void examples_relevant_check(struct manifest *m,
if (!streq(d->type, "example"))
continue;
+ if (!d->function) {
+ score_file_error(score, f, d->srcline+1,
+ "Function name not found in summary line");
+ continue;
+ }
for (i = 0; i < d->num_lines; i++) {
if (strstr(d->lines[i], d->function))
found = true;