Skip to content

Commit

Permalink
Debugged patient functions
Browse files Browse the repository at this point in the history
  • Loading branch information
AnxiousLunch committed Jan 6, 2024
1 parent cab5097 commit b858e32
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion user.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ void viewPrescriptions() {
int age;
while (fgets(line, sizeof(line), file)) {
line[strcspn(line, "\n")] = '\0';
if (sscanf(line, "%49[^,],%d,%9[^\n],%49[^,]", name, &age, gender, prescription) == 4) {
if (sscanf(line, "%49[^,],%d,%49[^\n],%49", name, &age, prescription) == 3) {
printf("\n%s, Age: %d, Gender: %s\n", name, age, gender);
printf("Prescription: %s\n", prescription);
} else {
Expand Down

0 comments on commit b858e32

Please sign in to comment.