mirror of
https://github.com/davatorium/rofi.git
synced 2024-11-25 13:55:34 -05:00
Fix silly little bug.
This commit is contained in:
parent
c7dcb4821a
commit
311cedf87f
1 changed files with 7 additions and 3 deletions
|
@ -63,13 +63,17 @@ static char **get_dmenu ( unsigned int *length )
|
|||
unsigned int rvlength = 1;
|
||||
|
||||
*length = 0;
|
||||
gchar *data = NULL;
|
||||
size_t data_l = 0;
|
||||
while ( ( getdelim ( &data, &data_l, config.separator, stdin ) > 0 ) ) {
|
||||
gchar *data = NULL;
|
||||
size_t data_l = 0;
|
||||
ssize_t l = 0;
|
||||
while ( ( l = getdelim ( &data, &data_l, config.separator, stdin ) ) > 0 ) {
|
||||
if ( rvlength < ( *length + 2 ) ) {
|
||||
rvlength *= 2;
|
||||
retv = g_realloc ( retv, ( rvlength ) * sizeof ( char* ) );
|
||||
}
|
||||
if ( data[l - 1] == config.separator ) {
|
||||
data[l - 1] = '\0';
|
||||
}
|
||||
|
||||
retv[( *length )] = data; //copy;
|
||||
retv[( *length ) + 1] = NULL;
|
||||
|
|
Loading…
Reference in a new issue