--- projects/libstatgrab/src/libstatgrab/error.c 2004/04/07 21:19:26 1.8 +++ projects/libstatgrab/src/libstatgrab/error.c 2004/04/07 21:47:50 1.9 @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA * - * $Id: error.c,v 1.8 2004/04/07 21:19:26 ats Exp $ + * $Id: error.c,v 1.9 2004/04/07 21:47:50 tdb Exp $ */ #ifdef HAVE_CONFIG_H @@ -35,7 +35,13 @@ static char error_arg[ERROR_ARG_MAX]; void sg_set_error(sg_error code, const char *arg) { error = code; - strlcpy(error_arg, arg, sizeof error_arg); + if (arg != NULL) { + strlcpy(error_arg, arg, sizeof error_arg); + } + else { + /* FIXME is this the best idea? */ + error_arg[0] = '\0'; + } } sg_error sg_get_error() {