X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=src%2Fclient%2Fmain.c;h=bf044436ab55574a5cf19a1ee59ff8b436b9eb32;hb=3432da85567f41563026c4ae9ef1edf958f57715;hp=8c4237e072f8e9ed07376daa9441250d0ff8de53;hpb=6d296fbff71ecee2f73e3e5ba8bcf06e446dc39b;p=tpg%2Fopendispense2.git diff --git a/src/client/main.c b/src/client/main.c index 8c4237e..bf04443 100644 --- a/src/client/main.c +++ b/src/client/main.c @@ -1112,7 +1112,7 @@ int ShowItemAt(int Row, int Col, int Width, int Index, int bHilighted) if( Width > 0 ) { // 4 preceding, 5 price - int nameWidth = Width - 4 - 4 - snprintf(NULL, 0, "%i", price/100); + int nameWidth = Width - 4 - snprintf(NULL, 0, " %4i", price); move( Row, Col ); if( Index >= 0 ) @@ -1138,7 +1138,7 @@ int ShowItemAt(int Row, int Col, int Width, int Index, int bHilighted) printw("%-*.*s", nameWidth, nameWidth, name); - printw(" %i.%02i", price/100, price%100); + printw(" %4i", price); } else { @@ -2253,9 +2253,10 @@ char *ReadLine(int Socket) if( newline ) { int newLen = newline - (buf+bufPos) + 1; bufValid = len - newLen; - bufPos += newLen; + len = newLen; } if( len + bufPos == BUFSIZ - 1 ) bufPos = 0; + else bufPos += len; } #if DEBUG_TRACE_SERVER