- Timestamp:
- Sep 8, 2023, 12:46:55 AM (16 months ago)
- Branches:
- master
- Children:
- 553f032f
- Parents:
- 3ee8853
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/iostream.cfa
r3ee8853 r2fa0237 1 1 2 // 2 3 // Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo … … 976 977 if ( f.flags.ignore ) { fmtstr[1] = '*'; start += 1; } 977 978 // no maximum width necessary because text ignored => width is read width 978 if ( f.wd != -1 ) { start += sprintf( &fmtstr[start], "%d", f.wd ); } 979 if ( f.wd != -1 ) { 980 // wd is buffer bytes available (for input chars + null terminator) 981 // rwd is count of input chars 982 int rwd = f.flags.rwd ? f.wd : (f.wd - 1); 983 start += sprintf( &fmtstr[start], "%d", rwd ); 984 } 979 985 980 986 if ( ! scanset ) { … … 993 999 } // if 994 1000 995 int check = f.wd - 1;1001 int check = f.wd - 2; 996 1002 if ( ! f.flags.rwd ) f.s[check] = '\0'; // insert sentinel 997 1003 len = fmt( is, fmtstr, f.s );
Note: See TracChangeset
for help on using the changeset viewer.