On Tue, Dec 27, 2011 at 06:49:33PM -0800, John Johansen wrote:
> Signed-off-by: John Johansen <[email protected]>
> ---
>  parser/parser_common.c |   13 ++++++-------
>  1 files changed, 6 insertions(+), 7 deletions(-)
> 
> diff --git a/parser/parser_common.c b/parser/parser_common.c
> index f409f87..59df46c 100644
> --- a/parser/parser_common.c
> +++ b/parser/parser_common.c
> @@ -54,17 +54,16 @@ void pwarn(char *fmt, ...)
>  {
>          va_list arg;
>          char *newfmt;
> -        int rc;
>  
>          if (conf_quiet || names_only || option == OPTION_REMOVE)
>                  return;
>  
> -        rc = asprintf(&newfmt, _("Warning from %s (%s%sline %d): %s"),
> -                      profilename ? profilename : "stdin",
> -                      current_filename ? current_filename : "",
> -                      current_filename ? " " : "",
> -                      current_lineno,
> -                      fmt);
> +        asprintf(&newfmt, _("Warning from %s (%s%sline %d): %s"),
> +              profilename ? profilename : "stdin",
> +              current_filename ? current_filename : "",
> +              current_filename ? " " : "",
> +              current_lineno,
> +              fmt);
>          if (!newfmt)
>                  return;
>  

I suspect the reason the rc variable got added was to avoid the unused
result warning on the asprintf call that results:

  parser_common.c: In function ‘pwarn’:
  parser_common.c:61:17: warning: ignoring return value of ‘asprintf’, declared 
with attribute warn_unused_result [-Wunused-result]


-- 
Steve Beattie
<[email protected]>
http://NxNW.org/~steve/

Attachment: signature.asc
Description: Digital signature

-- 
AppArmor mailing list
[email protected]
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/apparmor

Reply via email to