# HG changeset patch # User Matti Hamalainen # Date 1579284246 -7200 # Node ID f3b119599b3a4fb62155f5831780d3491eac10f1 # Parent f3ec1cb11cea96c24b83f368653502313d4d3ac3 Slight code cleanup on aisle nn_window_new(). diff -r f3ec1cb11cea -r f3b119599b3a ui.c --- a/ui.c Fri Jan 17 20:03:41 2020 +0200 +++ b/ui.c Fri Jan 17 20:04:06 2020 +0200 @@ -28,20 +28,21 @@ static nn_window_t *nn_window_new(const char *id) { - nn_window_t *res = th_malloc0(sizeof(nn_window_t)); + nn_window_t *win; - if (res == NULL) return NULL; + if ((win = th_malloc0(sizeof(nn_window_t))) == NULL) + return NULL; - res->data = th_ringbuf_new(SET_BACKBUF_LEN, nn_line_free); - if (res->data == NULL) + win->data = th_ringbuf_new(SET_BACKBUF_LEN, nn_line_free); + if (win->data == NULL) { - th_free(res); + th_free(win); return NULL; } - res->id = th_strdup(id); + win->id = th_strdup(id); - return res; + return win; }