提交 d0f95c78 编写于 作者: N Namhyung Kim 提交者: Michal Marek

kbuild: check return value of asprintf()

Check return value of asprintf() in docsect() and exit if error
occurs. This removes following warning:

  HOSTCC  scripts/basic/docproc
scripts/basic/docproc.c: In function ‘docsect’:
scripts/basic/docproc.c:336: warning: ignoring return value of ‘asprintf’,
				declared with attribute warn_unused_result
Signed-off-by: NNamhyung Kim <namhyung@gmail.com>
Acked-by: NRandy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: NMichal Marek <mmarek@suse.cz>
上级 b74b953b
......@@ -333,7 +333,10 @@ static void docsect(char *filename, char *line)
if (*s == '\n')
*s = '\0';
asprintf(&s, "DOC: %s", line);
if (asprintf(&s, "DOC: %s", line) < 0) {
perror("asprintf");
exit(1);
}
consume_symbol(s);
free(s);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册