Denis Vlasenko spotted the lack of bounds checking in my first attempt at
[oweals/busybox.git] / libbb / vherror_msg.c
1 /* vi: set sw=4 ts=4: */
2 /*
3  * Utility routines.
4  *
5  * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6  *
7  * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
8  */
9
10 #include <stdarg.h>
11 #include <netdb.h>
12 #include <stdio.h>
13
14 #include "libbb.h"
15
16
17 void bb_vherror_msg(const char *s, va_list p)
18 {
19         if(s == 0)
20                 s = "";
21         bb_verror_msg(s, p);
22         if (*s)
23                 fputs(": ", stderr);
24         herror("");
25 }