kbmap: avoid division by zero when window becomes too small

This commit is contained in:
cinap_lenrek 2020-12-27 23:39:28 +01:00
parent 0e632454e2
commit 0596178dd6

View file

@ -103,6 +103,8 @@ geometry(void)
Rectangle r;
rows = (Dy(screen->r)-2*MARGIN+PAD)/(font->height+PAD);
if(rows < 1)
rows = 1;
r = Rect(0,0,(Dx(screen->r)-2*MARGIN), font->height);
for(i=0; i<nmap; i++)