Fixed Makefile, removed warning.

git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@9 96b47cad-a561-4643-ad3b-153ac7d7599c
This commit is contained in:
frankmorgner
2010-01-05 14:04:04 +00:00
parent 08157f4e09
commit 01b3dad1bf
2 changed files with 12 additions and 5 deletions

View File

@@ -1,6 +1,13 @@
SUBDIRS = ccid picc_to_pcsc virtualsmartcard MAKEFLAGS += -rR --no-print-directory
default: all # Compiler
CC = gcc
CFLAGS = -Wall -g
LIBPCSCLITE_CFLAGS = `pkg-config --cflags --libs libpcsclite`
%: TARGETS = picc_to_pcsc
for d in $(SUBDIRS); do $(MAKE) $@ -C $$d; done
all: $(TARGETS)
picc_to_pcsc: picc_to_pcsc.c picc_to_pcsc.h
$(CC) $(CFLAGS) $(LIBPCSCLITE_CFLAGS) picc_to_pcsc.c -o $@

View File

@@ -160,7 +160,7 @@ unsigned int read_from_device(unsigned char *inputBuffer) {
buf = malloc(length); buf = malloc(length);
if(buf == NULL) { fprintf(stderr, "WAHH!\n"); return 0; } if(buf == NULL) { fprintf(stderr, "WAHH!\n"); return 0; }
int pos=0; int pos=0;
while(sscanf(line+(pos*3+5), " %x ", &(buf[pos])) == 1) { while(sscanf(line+(pos*3+5), " %x ", (unsigned int *) &(buf[pos])) == 1) {
printf("[%02X]", buf[pos]); printf("[%02X]", buf[pos]);
if(++pos >= length) break; if(++pos >= length) break;
} }