summaryrefslogtreecommitdiff
path: root/firmware/common/structec.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/common/structec.c')
-rw-r--r--firmware/common/structec.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/firmware/common/structec.c b/firmware/common/structec.c
index 7c76874..1f4205c 100644
--- a/firmware/common/structec.c
+++ b/firmware/common/structec.c
@@ -17,6 +17,7 @@
*
****************************************************************************/
+#include <ctype.h>
#include <string.h>
#include <inttypes.h>
#include "structec.h"
@@ -82,9 +83,14 @@ void structec_convert(void *structure, const char *ecinst,
break;
}
- /* This should be never reached. */
+ /* Skip N bytes, idea taken from metadata.c */
default:
+ {
+ if (isdigit(*ecinst_ring))
+ buf += (*ecinst_ring - '0');
+
break;
+ }
}
ecinst_ring++;
@@ -114,7 +120,9 @@ size_t structec_size(const char *ecinst)
case 'c': size += 1; break;
case 's': size += 2; break;
case 'l': size += 4; break;
- default: break;
+ default:
+ if (isdigit(*ecinst))
+ size += (*ecinst - '0');
}
} while (*(++ecinst) != '\0');