apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b..@apache.org
Subject svn commit: r956849 - /apr/apr/trunk/file_io/os2/readwrite.c
Date Tue, 22 Jun 2010 10:57:00 GMT
Author: bjh
Date: Tue Jun 22 10:56:59 2010
New Revision: 956849

URL: http://svn.apache.org/viewvc?rev=956849&view=rev
Log:
OS/2: Fix incorrect value in nbytes parameter to apr_file_read() after use of
apr_file_ungetc().

Modified:
    apr/apr/trunk/file_io/os2/readwrite.c

Modified: apr/apr/trunk/file_io/os2/readwrite.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/file_io/os2/readwrite.c?rev=956849&r1=956848&r2=956849&view=diff
==============================================================================
--- apr/apr/trunk/file_io/os2/readwrite.c (original)
+++ apr/apr/trunk/file_io/os2/readwrite.c Tue Jun 22 10:56:59 2010
@@ -55,9 +55,9 @@ APR_DECLARE(apr_status_t) apr_file_read(
 
     if (thefile->ungetchar != -1 && req_nbytes >= 1) {
         *(char *)buf = (char)thefile->ungetchar;
-        (char *)buf++;
-        (*nbytes)--;
         thefile->ungetchar = -1;
+        (*nbytes) = 1;
+        return APR_SUCCESS;
     }
 
     if (thefile->buffered) {



Mime
View raw message