diff --git a/source/rofi.c b/source/rofi.c index 9bc6e6c7..63db670a 100644 --- a/source/rofi.c +++ b/source/rofi.c @@ -995,7 +995,7 @@ MenuReturn menu ( char **lines, char **input, char *prompt, Time *time, int *shi // then dividing by columns. unsigned int max_rows = MIN ( config.menu_lines, (unsigned int) ( - ( num_lines + ( columns - num_lines % columns ) ) / + ( num_lines + ( columns - num_lines % columns ) % columns ) / ( columns ) ) ); @@ -1006,7 +1006,7 @@ MenuReturn menu ( char **lines, char **input, char *prompt, Time *time, int *shi // If it would fit in one column, only use one column. if ( num_lines < max_elements ) { - columns = ( num_lines + ( max_rows - num_lines % max_rows ) ) / max_rows; + columns = ( num_lines + ( max_rows - num_lines % max_rows ) % max_rows ) / max_rows; max_elements = config.menu_lines * columns; } } diff --git a/source/xrmoptions.c b/source/xrmoptions.c index 7cac0261..df51305e 100644 --- a/source/xrmoptions.c +++ b/source/xrmoptions.c @@ -185,9 +185,8 @@ void parse_xresource_free ( void ) void xresource_dump ( void ) { - const char * namePrefix = "rofi"; - const char * classPrefix = "rofi"; - unsigned int entries = sizeof ( xrmOptions ) / sizeof ( *xrmOptions ); + const char * namePrefix = "rofi"; + unsigned int entries = sizeof ( xrmOptions ) / sizeof ( *xrmOptions ); for ( unsigned int i = 0; i < entries; ++i ) { // Skip duplicates.