Browse Source

moved character definition into while loop

master
T. Meissner 11 years ago
parent
commit
29b41b440a
1 changed files with 1 additions and 2 deletions
  1. +1
    -2
      c_pointers/getline.c

+ 1
- 2
c_pointers/getline.c View File

@ -14,14 +14,13 @@ char *getLine(void) {
char *currentPosition = buffer;
size_t maximumLength = sizeIncrement;
size_t length = 0;
int character;
if (currentPosition == NULL) {
return NULL;
}
while (1) {
character =fgetc(stdin);
int character =fgetc(stdin);
if (character == '\n') {
break;
}


Loading…
Cancel
Save