mirror of
https://github.com/davatorium/rofi.git
synced 2025-04-07 17:33:14 -04:00
Fix bug with extra trailing \n
This commit is contained in:
parent
aeefabe7a0
commit
a0a5400c72
1 changed files with 2 additions and 0 deletions
|
@ -114,6 +114,7 @@ static pid_t exec_cmd ( const char *cmd, int run_in_term )
|
|||
}
|
||||
retv = reallocate ( retv, ( index + 2 ) * sizeof ( element* ) );
|
||||
retv[index] = allocate ( sizeof ( element ) );
|
||||
buffer[strlen ( buffer ) - 1] = '\0';
|
||||
char * start = NULL;
|
||||
retv[index]->index = strtol ( buffer, &start, 10 );
|
||||
snprintf ( retv[index]->name, RUN_DIALOG_NAME_LENGTH, "%s", start + 1 );
|
||||
|
@ -207,6 +208,7 @@ static void delete_entry ( const char *cmd )
|
|||
}
|
||||
retv = reallocate ( retv, ( index + 2 ) * sizeof ( element* ) );
|
||||
retv[index] = allocate ( sizeof ( element ) );
|
||||
buffer[strlen ( buffer ) - 1] = '\0';
|
||||
retv[index]->index = strtol ( buffer, &start, 10 );
|
||||
snprintf ( retv[index]->name, RUN_DIALOG_NAME_LENGTH, "%s", start + 1 );
|
||||
retv[index + 1] = NULL;
|
||||
|
|
Loading…
Add table
Reference in a new issue