diff options
Diffstat (limited to 'src/actions.c')
-rw-r--r-- | src/actions.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/actions.c b/src/actions.c index 887322e..d755e02 100644 --- a/src/actions.c +++ b/src/actions.c @@ -4951,13 +4951,12 @@ fdump (rp_screen *screen) cmdret * cmd_fdump (int interactively UNUSED, struct cmdarg **args) { + rp_screen *screen; + cmdret *ret; + char *dump; + if (args[0] == NULL) - { - char *s = fdump (current_screen()); - cmdret *ret = cmdret_new (RET_SUCCESS, "%s", s); - free (s); - return ret; - } + screen = current_screen (); else { int snum; @@ -4968,13 +4967,14 @@ cmd_fdump (int interactively UNUSED, struct cmdarg **args) else if (num_screens <= snum) return cmdret_new (RET_FAILURE, "fdump: unknown screen"); else - { - char *s = fdump (&screens[snum]); - cmdret *ret = cmdret_new (RET_SUCCESS, "%s", s); - free (s); - return ret; - } + screen = &screens[snum]; } + + dump = fdump (screen); + ret = cmdret_new (RET_SUCCESS, "%s", dump); + free (dump); + + return ret; } static cmdret * |