# HG changeset patch # User John W. Eaton # Date 1314202740 14400 # Node ID bac0858b92ee84e9500d9522fd32081ebbd5e150 # Parent b12e2cffaa2f245bf3ecea7e4aa7d7fc85f58a3a sscanf: correctly set output position when reading stops at end of string * file-io.cc (Fsscanf): Set POS output to string length if reading stops at end of string. diff -r b12e2cffaa2f -r bac0858b92ee src/file-io.cc --- a/src/file-io.cc Wed Aug 24 11:32:18 2011 -0400 +++ b/src/file-io.cc Wed Aug 24 12:19:00 2011 -0400 @@ -1249,7 +1249,8 @@ // position will clear it. std::string errmsg = os.error (); - retval(3) = os.tell () + 1; + retval(3) + = (os.eof () ? data.length () : os.tell ()) + 1; retval(2) = errmsg; retval(1) = count; retval(0) = tmp;