|
Lines 62-67
Link Here
|
| 62 |
} |
62 |
} |
| 63 |
// min of n and (length - pos) |
63 |
// min of n and (length - pos) |
| 64 |
int tmpInLen = (n < (m_length - m_pos)) ? n : (m_length - m_pos); |
64 |
int tmpInLen = (n < (m_length - m_pos)) ? n : (m_length - m_pos); |
|
|
65 |
if (tmpInLen > n) |
| 66 |
{ |
| 67 |
// This shouldn't happen, but it could if m_length were |
| 68 |
// negative (32bit vs. 64bit problem). Check it here to |
| 69 |
// prevent the possibility of a buffer overflow. |
| 70 |
return -1; |
| 71 |
} |
| 65 |
m_istr.read(c, tmpInLen); |
72 |
m_istr.read(c, tmpInLen); |
| 66 |
int lastRead = m_istr.gcount(); |
73 |
int lastRead = m_istr.gcount(); |
| 67 |
m_pos += lastRead; |
74 |
m_pos += lastRead; |