Kernel/vterm - Removed an unneeded divide
authorJohn Hodge <[email protected]>
Thu, 20 Oct 2011 14:29:54 +0000 (22:29 +0800)
committerJohn Hodge <[email protected]>
Thu, 20 Oct 2011 14:29:54 +0000 (22:29 +0800)
Kernel/drv/vterm.c

index ea184ee..1be52ac 100644 (file)
@@ -468,7 +468,8 @@ Uint64 VT_Read(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer)
                        ((char*)Buffer)[pos] = term->InputBuffer[term->InputRead];
                        pos ++;
                        term->InputRead ++;
-                       term->InputRead %= MAX_INPUT_CHARS8;
+                       while(term->InputRead > MAX_INPUT_CHARS8)
+                               term->InputRead -= MAX_INPUT_CHARS8;
                }
                break;
        
@@ -491,7 +492,8 @@ Uint64 VT_Read(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer)
                        codepoint_buf[pos] = codepoint_in[term->InputRead];
                        pos ++;
                        term->InputRead ++;
-                       term->InputRead %= MAX_INPUT_CHARS32;
+                       while(term->InputRead > MAX_INPUT_CHARS32)
+                               term->InputRead -= MAX_INPUT_CHARS32;
                }
                pos *= 4;
                break;

UCC git Repository :: git.ucc.asn.au