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: Namhyung Kim <namhyung@gmail.com>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
This commit is contained in:
Namhyung Kim 2010-10-22 23:32:10 +09:00 committed by Michal Marek
parent b74b953b99
commit d0f95c7826
1 changed files with 4 additions and 1 deletions

View File

@ -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);