Changeset 2594
- Timestamp:
- Mar 9, 2006, 7:38:07 PM (19 years ago)
- Location:
- branches/libc-0.6/src/emx
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/libc-0.6/src/emx/ChangeLog.LIBC
r2579 r2594 2 2 3 3 TODO: open replace on RAMFS fails with error 32! 4 5 2006-03-09: knut st. osmundsen <bird-gccos2-spam@anduin.net> 6 - libc: 7 o #62: Fixed incorrect EOF treatment in getdelim (and in getline since that's just a 8 special case of getdelim). 4 9 5 10 2006-03-07: knut st. osmundsen <bird-gccos2-spam@anduin.net> -
branches/libc-0.6/src/emx/src/lib/io/getdelim.c
r2254 r2594 46 46 * 47 47 * @returns number of bytes read. 48 * @returns -1 on failure , including EOF.48 * @returns -1 on failure - this includes EOF when nothing was retrieved. 49 49 * @param ppszString Where to buffer pointer is stored. *ppszString can of course be NULL. 50 50 * @param pcchString Size of the buffer pointed to by *ppszString. … … 81 81 */ 82 82 STREAM_LOCK(pStream); 83 ssize_t rc = -1;83 ssize_t rc = 0; 84 84 char *psz = *ppszString; 85 85 char *pszEnd = psz + *pcchString - 1; … … 90 90 int ch = _getc_inline(pStream); 91 91 if (ch == EOF) 92 { 93 if (psz == *ppszString) 94 rc = -1; 92 95 break; 96 } 93 97 if (psz == pszEnd) 94 98 { … … 100 104 char *pszNew = (char *)realloc(*ppszString, cch); 101 105 if (!pszNew) 106 { 107 rc = -1; 102 108 break; 109 } 103 110 104 111 psz = pszNew + (psz - *ppszString); … … 109 116 *psz++ = (char)ch; 110 117 if (ch == chDelim) 111 {112 rc = psz - *ppszString;113 118 break; 114 }115 119 } 116 120 STREAM_UNLOCK(pStream); 121 122 if (!rc) 123 rc = psz - *ppszString; 117 124 118 125 *psz = '\0';
Note:
See TracChangeset
for help on using the changeset viewer.