lkml.org 
[lkml]   [2009]   [Mar]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: lp: too large subtraction on unsigned?
From
Doesn't look like something is wrong, or I'm missing something...
:
> do {
>        if (canwrite > 0) {
>                ...
>                count -= written;
>        }

If there are chars left you write to the PP and take it out of the total

>        if (lf && canwrite <= 0) {
>                ...
>                count--;
>                ...
>        }
> } while (count > 0 && (CONSOLE_LP_STRICT || written > 0));

The second if is for translating \n to \r\n only if you've already
written everything (up to /n) to the PP

If count > 0 fails (that is, count == 0) you get out of the loop

--
-
Thiago Galesi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2009-03-02 00:45    [W:0.086 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site