forked from brmlab/brmbar-github
code done
This commit is contained in:
parent
dd772c2ea3
commit
0ed434d9d2
4 changed files with 16 additions and 12 deletions
3
brmbar.c
3
brmbar.c
|
@ -1,5 +1,6 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "dataio.h"
|
||||
|
||||
#define EAN_MAXLEN 32
|
||||
#define NAME_MAXLEN 128
|
||||
|
@ -95,7 +96,7 @@ void read_input()
|
|||
|
||||
// scan items
|
||||
for (i = 0; i < items_count; ++i) {
|
||||
if (!strncmp(buf, items[i].ean, strlen(items[i].ean))) {
|
||||
if (!strncmp(buf, items[i].ean, strlen(items[i].ean)) && strlen(items[i].ean)+1 == strlen(buf)) {
|
||||
if (items[i].price) {
|
||||
last_item = i;
|
||||
printf("\n%s %d Kc\n\n", items[i].name, items[i].price);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue