Thiago Jung Bauermann wrote: > El mar, 07-10-2008 a las 19:20 -0700, Michael Snyder escribió: >> +static void >> +exec_reverse_once (char *cmd, char *args, int from_tty) >> +{ >> + /* String buffer for command consing. */ >> + char reverse_command[512]; > >> + sprintf (reverse_command, "%s %s", cmd, args ? args : ""); >> + >> + execution_direction = EXEC_REVERSE; >> + execute_command (reverse_command, from_tty); >> + do_cleanups (old_chain); > > That fixed-length buffer being written with sprintf doesn't look good... > What do you think about using xstrprintf instead? That will remove the > possibility of buffer overflow, and also remove an arbitrary limit. How about this? (the function pointer idea I leave for a future enhancement):