Github user mike-jumper commented on a diff in the pull request:

    https://github.com/apache/guacamole-server/pull/156#discussion_r175279031
  
    --- Diff: src/terminal/terminal.c ---
    @@ -1594,7 +1598,13 @@ static int __guac_terminal_send_key(guac_terminal* 
term, int keysym, int pressed
             /* Non-printable keys */
             else {
     
    -            if (keysym == 0xFF08) return guac_terminal_send_string(term, 
"\x7F"); /* Backspace */
    +            /* Backspace can vary based on configuration of terminal by 
client. */
    +            if (keysym == 0xFF08) {
    +                char* backspace_str = malloc(sizeof(char) * 2);
    --- End diff --
    
    Keep in mind that dynamic allocation incurs overhead. In some cases, it 
makes good sense to do this, but it's hard to justify for a 2-byte string. A 
static buffer would be more appropriate here, particularly since you can 
initialize things cleanly and clearly inline.


---

Reply via email to