Handle NULL properly.

This commit is contained in:
Nicholas Marriott 2008-09-29 16:36:56 +00:00
parent 9e57336786
commit 8132b4d092

View File

@ -1,4 +1,4 @@
/* $Id: cmd-select-prompt.c,v 1.2 2008-06-25 20:44:26 nicm Exp $ */ /* $Id: cmd-select-prompt.c,v 1.3 2008-09-29 16:36:56 nicm Exp $ */
/* /*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net> * Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@ -70,6 +70,9 @@ cmd_select_prompt_callback(void *data, char *s)
char msg[128]; char msg[128];
u_int idx; u_int idx;
if (s == NULL)
return;
idx = strtonum(s, 0, UINT_MAX, &errstr); idx = strtonum(s, 0, UINT_MAX, &errstr);
if (errstr != NULL) { if (errstr != NULL) {
xsnprintf(msg, sizeof msg, "Index %s: %s", errstr, s); xsnprintf(msg, sizeof msg, "Index %s: %s", errstr, s);