Fix endline thingy in dmenu

This commit is contained in:
QC 2014-01-31 20:36:14 +01:00
parent 8725748916
commit 8310a97219
1 changed files with 2 additions and 1 deletions

View File

@ -66,7 +66,8 @@ static char **get_dmenu ( )
while ( fgets( buffer, 1024, stdin ) != NULL ) {
retv = realloc( retv, ( index+2 )*sizeof( char* ) );
retv[index] = strdup( buffer );
retv[index][strlen( buffer )-1] = '\0';
if( retv[index][strlen(buffer)-1] == '\n')
retv[index][strlen( buffer )-1] = '\0';
retv[index+1] = NULL;
index++;
}