1
0
Fork 0
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:
Qball Cow 2014-04-24 23:39:26 +02:00
parent aeefabe7a0
commit a0a5400c72

View file

@ -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;