Commit cd9d0943 authored by deuce's avatar deuce
Browse files

Remove some extra *2 in places where it's wrong.

parent aa6dff1e
......@@ -769,7 +769,7 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar
FREE_AND_NULL(sav[api->savnum].buf);
if ((sav[api->savnum].buf = malloc((width + 3) * (height + 2) * sizeof(struct vmem_cell)))==NULL) {
cprintf("UIFC line %d: error allocating %u bytes."
,__LINE__,(width+3)*(height+2)*2);
,__LINE__,(width+3)*(height+2)*sizeof(struct vmem_cell));
free(title);
if(!(api->mode&UIFC_NHM))
uifc_mouse_enable();
......@@ -794,7 +794,7 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar
else {
if((sav[api->savnum].buf=malloc((width+3)*(height+2)*sizeof(struct vmem_cell)))==NULL) {
cprintf("UIFC line %d: error allocating %u bytes."
,__LINE__,(width+3)*(height+2)*2);
,__LINE__,(width+3)*(height+2)*sizeof(struct vmem_cell));
free(title);
if(!(api->mode&UIFC_NHM))
uifc_mouse_enable();
......@@ -1078,7 +1078,7 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar
uifc_mouse_disable();
if((win=alloca((width+3)*(height+2)*sizeof(*win)))==NULL) {
cprintf("UIFC line %d: error allocating %u bytes."
,__LINE__,(width+3)*(height+2)*2);
,__LINE__,(width+3)*(height+2)*sizeof(*win));
return(-1);
}
inactive_win(win, s_left+left, s_top+top, s_left+left+width-1, s_top+top+height-1, y, hbrdrsize, cclr, lclr, hclr, top);
......@@ -2626,7 +2626,7 @@ void showbuf(int mode, int left, int top, int width, int height, char *title, ch
if((textbuf=(struct vmem_cell *)malloc((width-2-pad-pad)*lines*sizeof(*textbuf)))==NULL) {
cprintf("UIFC line %d: error allocating %u bytes\r\n"
,__LINE__,(width-2-pad-pad)*lines*2);
,__LINE__,(width-2-pad-pad)*lines*sizeof(*textbuf));
_setcursortype(cursor);
return;
}
......@@ -2688,12 +2688,12 @@ void showbuf(int mode, int left, int top, int width, int height, char *title, ch
&& mevnt.starty>=top+pad+1
&& mevnt.starty<=top+pad+(height/2)-2
&& mevnt.event==CIOLIB_BUTTON_1_CLICK) {
p -= ((width-2-pad-pad)*2*(height-5));
p -= ((width-2-pad-pad)*(height-5));
continue;
}
if(mevnt.startx == SCROLL_UP_BUTTON_X && mevnt.starty == SCROLL_UP_BUTTON_Y
&& mevnt.event==CIOLIB_BUTTON_1_CLICK) {
p -= ((width-2-pad-pad)*2);
p -= ((width-2-pad-pad));
continue;
}
/* Clicked Scroll Down */
......@@ -2702,12 +2702,12 @@ void showbuf(int mode, int left, int top, int width, int height, char *title, ch
&& mevnt.starty<=top+pad+height-2
&& mevnt.starty>=top+pad+height-(height/2+1)-2
&& mevnt.event==CIOLIB_BUTTON_1_CLICK) {
p += (width-2-pad-pad)*2*(height-5);
p += (width-2-pad-pad)*(height-5);
continue;
}
if(mevnt.startx == SCROLL_DN_BUTTON_X && mevnt.starty == SCROLL_DN_BUTTON_Y
&& mevnt.event==CIOLIB_BUTTON_1_CLICK) {
p += ((width-2-pad-pad)*2);
p += ((width-2-pad-pad));
continue;
}
/* Non-click events (drag, move, multiclick, etc) */
......@@ -2723,15 +2723,15 @@ void showbuf(int mode, int left, int top, int width, int height, char *title, ch
break;
case CIO_KEY_UP: /* up arrow */
p = p-((width-2-pad-pad)*2);
p = p-((width-2-pad-pad));
break;
case CIO_KEY_PPAGE: /* PgUp */
p = p-((width-2-pad-pad)*2*(height-5));
p = p-((width-2-pad-pad)*(height-5));
break;
case CIO_KEY_NPAGE: /* PgDn */
p += (width-2-pad-pad)*2*(height-5);
p += (width-2-pad-pad)*(height-5);
break;
case CIO_KEY_END: /* end */
......@@ -2739,7 +2739,7 @@ void showbuf(int mode, int left, int top, int width, int height, char *title, ch
break;
case CIO_KEY_DOWN: /* dn arrow */
p += ((width-2-pad-pad)*2);
p += ((width-2-pad-pad));
break;
case CIO_KEY_QUIT:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment