Error check in Coke_int_UpdateSlotStatuses
authorJohn Hodge <[email protected]>
Sun, 20 Feb 2011 08:35:37 +0000 (16:35 +0800)
committerJohn Hodge <[email protected]>
Sun, 20 Feb 2011 08:35:37 +0000 (16:35 +0800)
src/server/handler_coke.c

index da9fa18..da29580 100644 (file)
@@ -139,7 +139,10 @@ void Coke_int_UpdateSlotStatuses(void)
        printf("Coke_int_UpdateSlotStatuses: send s\n");
        #endif
        Writef("s\r\n");
-       ReadLine(sizeof tmp, tmp);      // Read back what we just said
+       do {
+               i = ReadLine(sizeof tmp, tmp);  // Read back what we just said
+               if( i == -1 )   goto ret;
+       } while(tmp[0] == ':' || tmp[0] == 's');
        
        for( i = 0; i <= 6; i ++ )
        {

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