Обновить cv1/program.c
This commit is contained in:
parent
fb4edab25d
commit
caa09c8456
@ -26,11 +26,11 @@ int main() {
|
|||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
|
|
||||||
printf("Zadaj hladanu surovinu:");
|
printf("Zadaj hladanu surovinu: ");
|
||||||
fgets(ingredient, MAX_NAME_LEN, stdin);
|
fgets(ingredient, MAX_NAME_LEN, stdin);
|
||||||
ingredient[strcspn(ingredient, "\n")] = '\0';
|
ingredient[strcspn(ingredient, "\n")] = '\0';
|
||||||
|
|
||||||
printf("Zadaj jedalny listok:\n");
|
printf("Zadaj jedalny listok: \n");
|
||||||
while (1) {
|
while (1) {
|
||||||
char name[MAX_NAME_LEN], price[MAX_NAME_LEN];
|
char name[MAX_NAME_LEN], price[MAX_NAME_LEN];
|
||||||
|
|
||||||
@ -52,7 +52,8 @@ int main() {
|
|||||||
int matches = 0;
|
int matches = 0;
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
char decoded_name[MAX_NAME_LEN];
|
char decoded_name[MAX_NAME_LEN];
|
||||||
strcpy(decoded_name, dishes[i][0]);
|
strncpy(decoded_name, dishes[i][0], MAX_NAME_LEN - 1);
|
||||||
|
decoded_name[MAX_NAME_LEN - 1] = '\0';
|
||||||
|
|
||||||
decodovane_slovo(decoded_name);
|
decodovane_slovo(decoded_name);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user