fix-window-size-20030327
authorJim Rees <rees@umich.edu>
Thu, 27 Mar 2003 20:29:51 +0000 (20:29 +0000)
committerJim Rees <rees@umich.edu>
Thu, 27 Mar 2003 20:29:51 +0000 (20:29 +0000)
Fix off-by-one error in window size calculation

src/afsmonitor/afsmon-win.c

index fa6f137..85ab1ed 100644 (file)
@@ -1052,13 +1052,13 @@ create_ovwFrame_objects()
        fflush(debugFD);
     }
 
-   /* get frame dimensions, it must be atleast 80x10 for any sensible output*/
+   /* get frame dimensions, it must be atleast 80x12 for any sensible output*/
    WOP_GETDIMENSIONS(ovwFrame->window,&frameDims);
    maxX = frameDims.maxx;
    maxY = frameDims.maxy;
-   if (maxX < MINX || maxY < MINY) {
-       sprintf(errMsg1,"[ %s ] Window size must be atleaset 80x12\n",
-               rn);
+   if (maxX + 1 < MINX || maxY + 1 < MINY) {
+       sprintf(errMsg1,"[ %s ] Window size %dx%d; must be at least 80x12\n",
+               rn, maxX + 1, maxY + 1);
        return(-1);
    }
    if (afsmon_debug)