1
0
Fork 0
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:
Qball Cow 2015-11-12 14:53:02 +01:00
parent c7dcb4821a
commit 311cedf87f

View file

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