Changeset 3d8702c in tol
- Timestamp:
- Aug 12, 2009, 5:04:58 PM (17 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- bfe66f2
- Parents:
- d3756e3
- File:
-
- 1 edited
-
tol/bbasic/txtalgeb.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tol/bbasic/txtalgeb.cpp
rd3756e3 r3d8702c 1558 1558 } 1559 1559 length_ = 0; 1560 BChar ch = '\0';1560 BChar ch = 1; 1561 1561 bool untilIsLF = until=='\n'; 1562 for(;(length_<=maxChars)&& (ch!=until)&&(!is.eof()); length_++)1562 for(;(length_<=maxChars)&&ch&&(ch!=until)&&(!is.eof()); length_++) 1563 1563 { 1564 1564 is.get(ch); … … 1572 1572 buffer_[length_] = ch; 1573 1573 } 1574 if(ch==until) { length_--; } 1575 if(ch=='\0') { length_--; } 1574 if((ch==until)&&length_) { length_--; } 1576 1575 buffer_[length_] = '\0'; 1577 1576 … … 1598 1597 } 1599 1598 length_ = 0; 1600 BChar ch = '\0', c;1599 BChar ch = 1, c; 1601 1600 bool untilIsLF = until=='\n'; 1602 for(;(length_<=maxChars)&& (ch!=until)&&(!feof(file)); length_++)1601 for(;(length_<=maxChars)&&ch&&(ch!=until)&&(!feof(file)); length_++) 1603 1602 { 1604 1603 ch = fgetc(file); … … 1612 1611 buffer_[length_] = ch; 1613 1612 } 1614 if(ch==until) { length_--; } 1615 if(ch=='\0') { length_--; } 1613 if((ch==until)&&length_) { length_--; } 1616 1614 buffer_[length_] = '\0'; 1617 1615 }
Note: See TracChangeset
for help on using the changeset viewer.
