Programming-in-C icon indicating copy to clipboard operation
Programming-in-C copied to clipboard

chapter09/ex1/9.9.c overflow

Open wiserltz opened this issue 4 years ago • 0 comments

starting from line 56

char word[10];
int  entries = 10;
int  entry;

int lookup(const struct entry dictionary[], const char search[],
		   const int entries);

printf("Enter word: ");
scanf("%14s", word);

patch should be: char word[10]; int entries = 10; int entry;

int lookup(const struct entry dictionary[], const char search[],
		   const int entries);

printf("Enter word: ");

// scanf("%14s", word); scanf("%9s", word);

wiserltz avatar Jul 17 '21 13:07 wiserltz