Changeset c62d2e1 in mainline
- Timestamp:
- 2010-02-23T19:31:32Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f389409
- Parents:
- 0b9ac3c
- Location:
- uspace/lib/libc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libc/generic/io/io.c
r0b9ac3c rc62d2e1 536 536 } 537 537 538 char *fgets(char *str, int size, FILE *stream) 539 { 540 char c; 541 int idx; 542 543 idx = 0; 544 while (idx < size - 1) { 545 c = fgetc(stream); 546 if (c == EOF) 547 break; 548 549 str[idx++] = c; 550 551 if (c == '\n') 552 break; 553 } 554 555 if (ferror(stream)) 556 return NULL; 557 558 if (idx == 0) 559 return NULL; 560 561 str[idx] = '\0'; 562 return str; 563 } 564 538 565 int getchar(void) 539 566 { -
uspace/lib/libc/include/stdio.h
r0b9ac3c rc62d2e1 110 110 /* Character and string input functions */ 111 111 extern int fgetc(FILE *); 112 extern char *fgets(char *, size_t, FILE *);112 extern char *fgets(char *, int, FILE *); 113 113 114 114 extern int getchar(void);
Note:
See TracChangeset
for help on using the changeset viewer.