summaryrefslogtreecommitdiffstats
path: root/pci.c
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@dside.dyndns.org>2011-03-09 16:55:27 +0100
committerSuren A. Chilingaryan <csa@dside.dyndns.org>2011-03-09 16:55:27 +0100
commita008b10d8488ef905a43de00ee5c8efd03b03ed6 (patch)
tree1d4330f9cbb72f641b197a445863a9012581e405 /pci.c
parentb0596cb0f01f885153abffaecfa248920cb8658b (diff)
downloadipecamera-a008b10d8488ef905a43de00ee5c8efd03b03ed6.tar.gz
ipecamera-a008b10d8488ef905a43de00ee5c8efd03b03ed6.tar.bz2
ipecamera-a008b10d8488ef905a43de00ee5c8efd03b03ed6.tar.xz
ipecamera-a008b10d8488ef905a43de00ee5c8efd03b03ed6.zip
Support for FPGA registers
Diffstat (limited to 'pci.c')
-rw-r--r--pci.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pci.c b/pci.c
index 9ddc1d6..9b6b011 100644
--- a/pci.c
+++ b/pci.c
@@ -22,7 +22,7 @@
#include "ipecamera.h"
#include "error.h"
-#define BIT_MASK(bits) ((1 << (bits)) - 1)
+#define BIT_MASK(bits) ((1l << (bits)) - 1)
//#define PCILIB_FILE_IO
@@ -232,7 +232,7 @@ pcilib_register_bank_t pcilib_find_bank(pcilib_t *ctx, const char *bank) {
return -1;
}
- if (sscanf(bank,"%lx", &addr) == 1) {
+ if (pcilib_isxnumber(bank)&&(sscanf(bank,"%lx", &addr) == 1)) {
res = pcilib_find_bank_by_addr(ctx, addr);
if (res != PCILIB_REGISTER_BANK_INVALID) return res;
}