projects
/
framework
/
connectivity
/
neard.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6419558
)
nfctype2: Get the actual tag data length when trying to write an NDEF
author
Samuel Ortiz
<sameo@linux.intel.com>
Fri, 15 Mar 2013 19:53:20 +0000
(20:53 +0100)
committer
Samuel Ortiz
<sameo@linux.intel.com>
Fri, 15 Mar 2013 19:53:20 +0000
(20:53 +0100)
plugins/nfctype2.c
patch
|
blob
|
history
diff --git
a/plugins/nfctype2.c
b/plugins/nfctype2.c
index
51e2056
..
15fd046
100644
(file)
--- a/
plugins/nfctype2.c
+++ b/
plugins/nfctype2.c
@@
-436,8
+436,10
@@
static int nfctype2_write(uint32_t adapter_idx, uint32_t target_idx,
* including TLV's is NDEF_MAX_SIZE
*/
if (near_tag_get_memory_layout(tag) == NEAR_TAG_MEMORY_STATIC) {
- if ((ndef->length + 3) > NDEF_MAX_SIZE) {
- near_error("not enough space on tag");
+ if ((ndef->length + 3) > near_tag_get_data_length(tag)) {
+ near_error("Not enough space on tag %zd %zd",
+ ndef->length,
+ near_tag_get_data_length(tag));
err = -ENOSPC;
goto out_err;
}