From: bdemsky Date: Mon, 9 Mar 2015 22:13:13 +0000 (-0700) Subject: bug fix X-Git-Url: http://plrg.eecs.uci.edu/git/?p=satlib.git;a=commitdiff_plain;h=62e3101fad910dbe37baa6fdac866b36cb81abe8;ds=sidebyside bug fix --- diff --git a/glucose-syrup/incremental/Main.cc b/glucose-syrup/incremental/Main.cc index 6b7ed12..9183e8e 100644 --- a/glucose-syrup/incremental/Main.cc +++ b/glucose-syrup/incremental/Main.cc @@ -67,13 +67,11 @@ int outoffset; int getInt() { if (offset>=length) { - ssize_t ptr; offset = 0; - do { - ptr=read(0, buffer, sizeof(int)*IS_BUFFERSIZE); - if (ptr == -1 || ptr == 0) - exit(-1); - } while(ptr==0); + ssize_t ptr=read(0, buffer, sizeof(int)*IS_BUFFERSIZE); + if (ptr == -1 || ptr == 0) + exit(-1); + ssize_t bytestoread=(4-(ptr & 3)) & 3; while(bytestoread != 0) { ssize_t p=read(0, &((char *)buffer)[ptr], bytestoread); diff --git a/zchaff64/inc_solver.cpp b/zchaff64/inc_solver.cpp index eda4eb0..1cc57ef 100644 --- a/zchaff64/inc_solver.cpp +++ b/zchaff64/inc_solver.cpp @@ -68,13 +68,11 @@ int outoffset; int getInt() { if (offset>=length) { - ssize_t ptr; offset = 0; - do { - ptr=read(0, buffer, sizeof(int)*IS_BUFFERSIZE); - if (ptr == -1 || ptr == 0) - exit(-1); - } while(ptr==0); + ssize_t ptr=read(0, buffer, sizeof(int)*IS_BUFFERSIZE); + if (ptr == -1 || ptr == 0) + exit(-1); + ssize_t bytestoread=(4-(ptr & 3)) & 3; while(bytestoread != 0) { ssize_t p=read(0, &((char *)buffer)[ptr], bytestoread);