[pacman-dev] [PATCH] Prevent warnings with unchecked asprintf and FORTIFY_SOURCE

Andres P aepd87 at gmail.com
Sun Jun 27 23:11:09 EDT 2010


On Sun, Jun 27, 2010 at 9:26 PM, Andres P <aepd87 at gmail.com> wrote:
>  src/pacman/util.c |   33 ++++++++++++++++++++++-----------
>  1 files changed, 22 insertions(+), 11 deletions(-)
>
> diff --git a/src/pacman/util.c b/src/pacman/util.c
> index de1b162..1b2f451 100644
> --- a/src/pacman/util.c
> +++ b/src/pacman/util.c
> @@ -44,6 +44,17 @@
>  #include "conf.h"
>  #include "callback.h"
>
> +/* error handling in a single fn please */
> +void vw_asprintf(char **str, const char *fmt, ...)
> +{
> +       va_list args;
> +       va_start(args, fmt);
> +       if(vasprintf(str, fmt, args) != 0) {

err, == -1

Andres P


More information about the pacman-dev mailing list