kconfig: add xrealloc() helper
We already have xmalloc(), xcalloc(). Add xrealloc() as well to save tedious error handling. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
*
|
||||
*/
|
||||
#include "nconf.h"
|
||||
#include "lkc.h"
|
||||
|
||||
/* a list of all the different widgets we use */
|
||||
attributes_t attributes[ATTR_MAX+1] = {0};
|
||||
@@ -374,7 +375,7 @@ int dialog_inputbox(WINDOW *main_window,
|
||||
|
||||
if (strlen(init)+1 > *result_len) {
|
||||
*result_len = strlen(init)+1;
|
||||
*resultp = result = realloc(result, *result_len);
|
||||
*resultp = result = xrealloc(result, *result_len);
|
||||
}
|
||||
|
||||
/* find the widest line of msg: */
|
||||
|
Reference in New Issue
Block a user