Changeset 01cc7b4 in mainline for uspace/lib/c/generic/stdio/scanf.c
- Timestamp:
- 2018-06-13T10:59:47Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f47a905
- Parents:
- ed18e14
- git-author:
- Jiri Svoboda <jiri@…> (2018-06-11 18:54:14)
- git-committer:
- Jiri Svoboda <jiri@…> (2018-06-13 10:59:47)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/stdio/scanf.c
red18e14 r01cc7b4 46 46 #include <stdio.h> 47 47 #include <stdlib.h> 48 #include "../private/stdio.h" 49 #include "../private/sstream.h" 48 50 49 51 typedef enum { … … 1338 1340 { 1339 1341 va_list args; 1340 FILE *f;1342 FILE f; 1341 1343 int rc; 1342 1344 1343 f = fopen("/tmp/test.tmp", "wt"); 1344 if (f == NULL) 1345 return EOF; 1346 1347 if (fputs(s, f) == EOF) 1348 return EOF; 1349 1350 if (fclose(f) == EOF) 1351 return EOF; 1352 1353 f = fopen("/tmp/test.tmp", "rt"); 1354 if (f == NULL) { 1355 printf("failed to open for reading\n"); 1356 return EOF; 1357 } 1345 __sstream_init(s, &f); 1358 1346 1359 1347 va_start(args, fmt); 1360 rc = xxvfscanf( f, fmt, args);1348 rc = xxvfscanf(&f, fmt, args); 1361 1349 va_end(args); 1362 1350 1363 fclose(f);1364 1365 1351 return rc; 1366 1352 }
Note:
See TracChangeset
for help on using the changeset viewer.